Skip to content

Commit fb42ec1

Browse files
committed
Try to re-add USB support...
1 parent d7a7a30 commit fb42ec1

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

stm/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ SRC_S = \
2929
startup_stm32f40xx.s \
3030

3131
PY_O = \
32-
nlrthumb.o \
32+
# nlrthumb.o \
3333
malloc.o \
3434
qstr.o \
35-
runtime.o \
36-
vm.o \
3735
# misc.o \
3836
lexer.o \
3937
parse.o \
@@ -45,6 +43,8 @@ PY_O = \
4543
asmthumb.o \
4644
emitnthumb.o \
4745
emitinlinethumb.o \
46+
runtime.o \
47+
vm.o \
4848
4949
SRC_FATFS = \
5050
ff.c \

stm/lcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include <stm32f4xx_gpio.h>
2+
3+
#include "misc.h"
24
#include "systick.h"
35
#include "lcd.h"
46
#include "font_petme128_8x8.h"

stm/lib/usbd_pyb_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
*/
6565

6666
/* Includes ------------------------------------------------------------------*/
67+
#include <stdio.h>
68+
6769
#include "usbd_cdc_core.h"
6870
#include "usbd_desc.h"
6971
#include "usbd_req.h"

stm/main.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "led.h"
1010
#include "lcd.h"
1111
#include "storage.h"
12+
#include "usb.h"
1213

1314
static void impl02_c_version() {
1415
int x = 0;
@@ -199,6 +200,7 @@ void __fatal_error(const char *msg) {
199200
#include "compile.h"
200201
#include "runtime.h"
201202

203+
#if 0
202204
py_obj_t pyb_delay(py_obj_t count) {
203205
sys_tick_delay_ms(rt_get_int(count));
204206
return py_const_none;
@@ -216,13 +218,14 @@ py_obj_t pyb_sw() {
216218
return py_const_false;
217219
}
218220
}
221+
#endif
219222

220223
#include "ff.h"
221224
FATFS fatfs0;
222225

223-
#include "nlr.h"
224226

225227
/*
228+
#include "nlr.h"
226229
void g(uint i) {
227230
printf("g:%d\n", i);
228231
if (i & 1) {
@@ -327,8 +330,8 @@ int main() {
327330
storage_init();
328331

329332
// Python init
330-
qstr_init();
331-
rt_init();
333+
//qstr_init();
334+
//rt_init();
332335

333336
// print a message
334337
printf(" micro py board\n");
@@ -408,18 +411,8 @@ int main() {
408411
// turn boot-up LED off
409412
led_state(PYB_LED_G1, 0);
410413

411-
/*
412-
for (;;) {
413-
led_state(PYB_LED_G2, 1);
414-
sys_tick_wait_at_least(sys_tick_counter, 500);
415-
led_state(PYB_LED_G2, 0);
416-
sys_tick_wait_at_least(sys_tick_counter, 500);
417-
}
418-
*/
419-
420414
// USB
421-
if (0) {
422-
void usb_init();
415+
if (1) {
423416
usb_init();
424417
}
425418

stm/usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "usbd_pyb_core.h"
55
#include "usbd_usr.h"
66
#include "usbd_desc.h"
7+
#include "usb.h"
78

89
extern CDC_IF_Prop_TypeDef VCP_fops;
910

stm/usb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
void usb_init();
2+
void usb_vcp_send(const char* str, int len);

0 commit comments

Comments
 (0)