stmhal: Add simple README.txt to freshly-created filesystem.
This commit is contained in:
parent
203bc98804
commit
f6d25ecf7b
@ -137,6 +137,21 @@ static const char fresh_pybcdc_inf[] =
|
|||||||
#include "pybcdc.h"
|
#include "pybcdc.h"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
static const char fresh_readme_txt[] =
|
||||||
|
"This is a Micro Python board\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"You can get started right away by writing your Python code in 'main.py'.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"For a serial prompt:\r\n"
|
||||||
|
" - Windows: you need to go to 'Device manager', right click on the unknown device,\r\n"
|
||||||
|
" then update the driver software, using the 'pybcdc.inf' file found on this drive.\r\n"
|
||||||
|
" Then use a terminal program like Hyperterminal or putty.\r\n"
|
||||||
|
" - Mac OS X: use the command: screen /dev/tty.usbmodem*\r\n"
|
||||||
|
" - Linux: use the command: screen /dev/ttyACM0\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"Please visit http://micropython.org/help/ for further help.\r\n"
|
||||||
|
;
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
// TODO disable JTAG
|
// TODO disable JTAG
|
||||||
|
|
||||||
@ -315,6 +330,11 @@ soft_reset:
|
|||||||
f_write(&fp, fresh_pybcdc_inf, sizeof(fresh_pybcdc_inf) - 1 /* don't count null terminator */, &n);
|
f_write(&fp, fresh_pybcdc_inf, sizeof(fresh_pybcdc_inf) - 1 /* don't count null terminator */, &n);
|
||||||
f_close(&fp);
|
f_close(&fp);
|
||||||
|
|
||||||
|
// create readme file
|
||||||
|
f_open(&fp, "0:/README.txt", FA_WRITE | FA_CREATE_ALWAYS);
|
||||||
|
f_write(&fp, fresh_readme_txt, sizeof(fresh_readme_txt) - 1 /* don't count null terminator */, &n);
|
||||||
|
f_close(&fp);
|
||||||
|
|
||||||
// keep LED on for at least 200ms
|
// keep LED on for at least 200ms
|
||||||
sys_tick_wait_at_least(start_tick, 200);
|
sys_tick_wait_at_least(start_tick, 200);
|
||||||
led_state(PYB_LED_R2, 0);
|
led_state(PYB_LED_R2, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user