File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -527,18 +527,23 @@ extern RtcControllerClass rtc_controller;
527527 */
528528class USBClass {
529529public:
530+ USBClass ()
531+ : _power{PB_14, 0 }
532+ , _usbflag{PB_15}
533+ {};
534+
530535 /* *
531536 * Enable power to USBA VBUS.
532537 */
533538 void powerEnable () {
534- power = 0 ;
539+ _power = 0 ;
535540 }
536541
537542 /* *
538543 * Disable power to USBA VBUS.
539544 */
540545 void powerDisable () {
541- power = 1 ;
546+ _power = 1 ;
542547 }
543548
544549 /* *
@@ -547,12 +552,12 @@ class USBClass {
547552 * @return true if OK, false if fault
548553 */
549554 bool vflagRead () {
550- return usbflag ;
555+ return _usbflag ;
551556 }
552557
553558private:
554- mbed::DigitalOut power = mbed::DigitalOut(PB_14) ;
555- mbed::DigitalIn usbflag = mbed::DigitalIn(PB_15) ;
559+ mbed::DigitalOut _power ;
560+ mbed::DigitalIn _usbflag ;
556561};
557562
558563
You can’t perform that action at this time.
0 commit comments