@@ -243,24 +243,23 @@ enum BoardTypes detectBoardType()
243243void portentaMachineControlPowerHandling ()
244244{
245245 // Determine if we're running on Machine Control or not on the first call to mount(), mkfs(),
246- // register_hotplug_callback(), or register_unplug_callback() -->
246+ // register_hotplug_callback(), or register_unplug_callback()
247247 if (false == hasMountedBefore)
248248 {
249249 hasMountedBefore = true ;
250250 if (BOARD_MACHINE_CONTROL == detectBoardType ())
251251 {
252252 runningOnMachineControl = true ;
253253 }
254- }
255- // <--
256254#if defined(ARDUINO_PORTENTA_H7_M7)
257- if (true == runningOnMachineControl)
258- {
259- // We need to apply power manually to the female USB A connector on the Machine Control
260- mbed::DigitalOut enablePower (PB_14, 0 );
261- }
255+ if (true == runningOnMachineControl)
256+ {
257+ // We need to apply power manually to the female USB A connector on the Machine Control
258+ mbed::DigitalOut enablePower (PB_14, 0 );
259+ }
262260#endif
263- } // End of portentaMachineControl()
261+ }
262+ } // End of portentaMachineControlPowerHandling()
264263
265264void deleteDevice (const enum StorageDevices deviceName, struct DeviceFileSystemCombination * const deviceFileSystemCombination)
266265{
@@ -556,7 +555,7 @@ int register_callback(const enum StorageDevices deviceName, void (* const callba
556555 // base-class object, and dynamic_cast wouldn't work anyway because compilation is done with -fno-rtti
557556 usbHostDevice = static_cast <USBHostMSD*>(usb.device );
558557 }
559- bool attachCallbackReturn = false ;
558+ bool attachCallbackReturn;
560559 if (CALLBACK_HOTPLUG == callbackType)
561560 {
562561 attachCallbackReturn = usbHostDevice->attach_detected_callback (callbackFunction);
@@ -657,7 +656,7 @@ int umount(const enum StorageDevices deviceName)
657656 return -1 ;
658657 }
659658 // See note (1) at the bottom of the file
660- int unmountRet = deviceFileSystemCombination->fileSystem ->unmount ();
659+ const int unmountRet = deviceFileSystemCombination->fileSystem ->unmount ();
661660 if (0 == unmountRet)
662661 {
663662 // Ok to delete with base class pointer because the destructor of the base class is virtual
@@ -682,13 +681,10 @@ int register_hotplug_callback(const enum StorageDevices deviceName, void (* cons
682681 errno = callbackReturn;
683682 return -1 ;
684683 }
685- else
686- {
687- return 0 ;
688- }
684+ return 0 ;
689685} // End of register_hotplug_callback()
690686
691- // Not supported by the layer below on these platforms , but might be on other platforms
687+ // Currently not supported on any platform , but might be in the future
692688int deregister_hotplug_callback (const enum StorageDevices deviceName)
693689{
694690 (void ) deviceName; // Remove when implemented, only here to silence -Wunused-parameter
@@ -704,13 +700,10 @@ int register_unplug_callback(const enum StorageDevices deviceName, void (* const
704700 errno = callbackReturn;
705701 return -1 ;
706702 }
707- else
708- {
709- return 0 ;
710- }
711- } // End of register__unplug_callback()
703+ return 0 ;
704+ } // End of register_unplug_callback()
712705
713- // Not supported by the layer below on these platforms , but might be on other platforms
706+ // Currently not supported on any platform , but might be in the future
714707int deregister_unplug_callback (const enum StorageDevices deviceName)
715708{
716709 (void ) deviceName; // Remove when implemented, only here to silence -Wunused-parameter
0 commit comments