Make use of the mbed tracing subsystem instead of basic printing
This enables use of the mbed tracing subsystem for the entire source
code of the project. All the uses of printfs are now appropriately
tagged and assigned a trace level, as in the following example:

[INFO][FS]: Unmounting the filesystem...
[INFO][FS]: OK
[INFO][USBM]: Switching to the usb mass storage mode...
[INFO][USBM]: Disconnecting the usb mass storage device...
[INFO][USBM]: Switched usb mass storage mode off.
[INFO][FS]: Mounting the filesystem...
[INFO][FS]: OK

This was also done in a way that the tracing is thread safe, using a
mutex to lock and unlock as needed.

Note that this cannot be turned on or off yet during build. It is
currently always enabled.
1 parent 23ee3e6 commit 449ba6ed185b5568579528f07f332bb3970189ba
@Xogium Xogium authored on 30 Mar 2023
Showing 7 changed files
View
CMakeLists.txt
View
include/Filesystem.h
View
include/FlashErase.h
View
src/Filesystem.cpp
View
src/FlashErase.cpp
View
src/MyUSBMSD.cpp
View
src/main.cpp