Commit fb42ec17 authored by Damien's avatar Damien
Browse files

Try to re-add USB support...

parent d7a7a30a
...@@ -29,11 +29,9 @@ SRC_S = \ ...@@ -29,11 +29,9 @@ SRC_S = \
startup_stm32f40xx.s \ startup_stm32f40xx.s \
PY_O = \ PY_O = \
nlrthumb.o \ # nlrthumb.o \
malloc.o \ malloc.o \
qstr.o \ qstr.o \
runtime.o \
vm.o \
# misc.o \ # misc.o \
lexer.o \ lexer.o \
parse.o \ parse.o \
...@@ -45,6 +43,8 @@ PY_O = \ ...@@ -45,6 +43,8 @@ PY_O = \
asmthumb.o \ asmthumb.o \
emitnthumb.o \ emitnthumb.o \
emitinlinethumb.o \ emitinlinethumb.o \
runtime.o \
vm.o \
SRC_FATFS = \ SRC_FATFS = \
ff.c \ ff.c \
......
#include <stm32f4xx_gpio.h> #include <stm32f4xx_gpio.h>
#include "misc.h"
#include "systick.h" #include "systick.h"
#include "lcd.h" #include "lcd.h"
#include "font_petme128_8x8.h" #include "font_petme128_8x8.h"
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include "usbd_cdc_core.h" #include "usbd_cdc_core.h"
#include "usbd_desc.h" #include "usbd_desc.h"
#include "usbd_req.h" #include "usbd_req.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "led.h" #include "led.h"
#include "lcd.h" #include "lcd.h"
#include "storage.h" #include "storage.h"
#include "usb.h"
static void impl02_c_version() { static void impl02_c_version() {
int x = 0; int x = 0;
...@@ -199,6 +200,7 @@ void __fatal_error(const char *msg) { ...@@ -199,6 +200,7 @@ void __fatal_error(const char *msg) {
#include "compile.h" #include "compile.h"
#include "runtime.h" #include "runtime.h"
#if 0
py_obj_t pyb_delay(py_obj_t count) { py_obj_t pyb_delay(py_obj_t count) {
sys_tick_delay_ms(rt_get_int(count)); sys_tick_delay_ms(rt_get_int(count));
return py_const_none; return py_const_none;
...@@ -216,13 +218,14 @@ py_obj_t pyb_sw() { ...@@ -216,13 +218,14 @@ py_obj_t pyb_sw() {
return py_const_false; return py_const_false;
} }
} }
#endif
#include "ff.h" #include "ff.h"
FATFS fatfs0; FATFS fatfs0;
#include "nlr.h"
/* /*
#include "nlr.h"
void g(uint i) { void g(uint i) {
printf("g:%d\n", i); printf("g:%d\n", i);
if (i & 1) { if (i & 1) {
...@@ -327,8 +330,8 @@ int main() { ...@@ -327,8 +330,8 @@ int main() {
storage_init(); storage_init();
// Python init // Python init
qstr_init(); //qstr_init();
rt_init(); //rt_init();
// print a message // print a message
printf(" micro py board\n"); printf(" micro py board\n");
...@@ -408,18 +411,8 @@ int main() { ...@@ -408,18 +411,8 @@ int main() {
// turn boot-up LED off // turn boot-up LED off
led_state(PYB_LED_G1, 0); led_state(PYB_LED_G1, 0);
/*
for (;;) {
led_state(PYB_LED_G2, 1);
sys_tick_wait_at_least(sys_tick_counter, 500);
led_state(PYB_LED_G2, 0);
sys_tick_wait_at_least(sys_tick_counter, 500);
}
*/
// USB // USB
if (0) { if (1) {
void usb_init();
usb_init(); usb_init();
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "usbd_pyb_core.h" #include "usbd_pyb_core.h"
#include "usbd_usr.h" #include "usbd_usr.h"
#include "usbd_desc.h" #include "usbd_desc.h"
#include "usb.h"
extern CDC_IF_Prop_TypeDef VCP_fops; extern CDC_IF_Prop_TypeDef VCP_fops;
......
void usb_init();
void usb_vcp_send(const char* str, int len);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment