Skip to content

Commit f6d25ec

Browse files
committed
stmhal: Add simple README.txt to freshly-created filesystem.
1 parent 203bc98 commit f6d25ec

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

stmhal/main.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,21 @@ static const char fresh_pybcdc_inf[] =
137137
#include "pybcdc.h"
138138
;
139139

140+
static const char fresh_readme_txt[] =
141+
"This is a Micro Python board\r\n"
142+
"\r\n"
143+
"You can get started right away by writing your Python code in 'main.py'.\r\n"
144+
"\r\n"
145+
"For a serial prompt:\r\n"
146+
" - Windows: you need to go to 'Device manager', right click on the unknown device,\r\n"
147+
" then update the driver software, using the 'pybcdc.inf' file found on this drive.\r\n"
148+
" Then use a terminal program like Hyperterminal or putty.\r\n"
149+
" - Mac OS X: use the command: screen /dev/tty.usbmodem*\r\n"
150+
" - Linux: use the command: screen /dev/ttyACM0\r\n"
151+
"\r\n"
152+
"Please visit http://micropython.org/help/ for further help.\r\n"
153+
;
154+
140155
int main(void) {
141156
// TODO disable JTAG
142157

@@ -315,6 +330,11 @@ int main(void) {
315330
f_write(&fp, fresh_pybcdc_inf, sizeof(fresh_pybcdc_inf) - 1 /* don't count null terminator */, &n);
316331
f_close(&fp);
317332

333+
// create readme file
334+
f_open(&fp, "0:/README.txt", FA_WRITE | FA_CREATE_ALWAYS);
335+
f_write(&fp, fresh_readme_txt, sizeof(fresh_readme_txt) - 1 /* don't count null terminator */, &n);
336+
f_close(&fp);
337+
318338
// keep LED on for at least 200ms
319339
sys_tick_wait_at_least(start_tick, 200);
320340
led_state(PYB_LED_R2, 0);

0 commit comments

Comments
 (0)