stm32duino / Arduino_Tools

Contains upload tools for STM32 based boards
Other
89 stars 64 forks source link

MassStorageCopy updated to manage several node names. #8

Closed fpistm closed 7 years ago

fpistm commented 7 years ago

Depending of the board revision, mount point name could be different. Ex for: STM32F030R8 with a rev 1 node name is : "NUCLEO" while it is "NODE_F030R8" for rev c

Ex: in boards.txt we could have: Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.node="NODE_F030R8,NUCLEO"

Fix #6

Signed-off-by: Frederic Pillon frederic.pillon@st.com

RickKimball commented 7 years ago

This seems to work for my board that uses NUCLEO as the volume label.

I did see some multiple warnings when I compiled:

gcc -m32 -c massStorageCopy.c
massStorageCopy.c: In function ‘main’:
massStorageCopy.c:69:18: warning: implicit declaration of function ‘isprint’ [-Wimplicit-function-declaration]
         else if (isprint (optopt))

You might want to add a #include line

$ git diff
diff --git a/src/massStorageCopy/massStorageCopy.c b/src/massStorageCopy/massStorageCopy.c
index 6fd5acc..d3c7dfc 100644
--- a/src/massStorageCopy/massStorageCopy.c
+++ b/src/massStorageCopy/massStorageCopy.c
@@ -5,6 +5,7 @@
 #include <mntent.h>
 #include <unistd.h>
 #include <errno.h>
+#include <ctype.h>

 static char *input_path = NULL;
 static char *output_path = NULL;
$ 
fpistm commented 7 years ago

I will add it. I didn't have this warning on my OS. I try to not release code with warning ^^

ghost commented 7 years ago

MassStorageCopy updated for MacOSX. Source file modified to be as close as Linux source file. It will be easier to maintain in the future. Tested on El Capitan version 10.11.6.