File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -527,18 +527,23 @@ extern RtcControllerClass rtc_controller;
527
527
*/
528
528
class USBClass {
529
529
public:
530
+ USBClass ()
531
+ : _power{PB_14, 0 }
532
+ , _usbflag{PB_15}
533
+ {};
534
+
530
535
/* *
531
536
* Enable power to USBA VBUS.
532
537
*/
533
538
void powerEnable () {
534
- power = 0 ;
539
+ _power = 0 ;
535
540
}
536
541
537
542
/* *
538
543
* Disable power to USBA VBUS.
539
544
*/
540
545
void powerDisable () {
541
- power = 1 ;
546
+ _power = 1 ;
542
547
}
543
548
544
549
/* *
@@ -547,12 +552,12 @@ class USBClass {
547
552
* @return true if OK, false if fault
548
553
*/
549
554
bool vflagRead () {
550
- return usbflag ;
555
+ return _usbflag ;
551
556
}
552
557
553
558
private:
554
- mbed::DigitalOut power = mbed::DigitalOut(PB_14) ;
555
- mbed::DigitalIn usbflag = mbed::DigitalIn(PB_15) ;
559
+ mbed::DigitalOut _power ;
560
+ mbed::DigitalIn _usbflag ;
556
561
};
557
562
558
563
You can’t perform that action at this time.
0 commit comments