diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-15 14:46:35 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-15 14:46:35 +0000 |
commit | 6c2455f4810f8dd048a3ff13a233a5f13b556ea4 (patch) | |
tree | c4e9204829dacc45f8648f26b80c428fae720eef | |
parent | fdbc22e4d27b9d1c686647c9c67a32206f7bc83a (diff) | |
download | micropython-6c2455f4810f8dd048a3ff13a233a5f13b556ea4.tar.gz micropython-6c2455f4810f8dd048a3ff13a233a5f13b556ea4.zip |
stmhal: Put an array in ROM.
-rw-r--r-- | stmhal/usb.c | 2 | ||||
-rw-r--r-- | stmhal/usbd_cdc_interface.c | 11 | ||||
-rw-r--r-- | stmhal/usbd_cdc_interface.h | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c index 21b88f9a1c..5cf7b5f32c 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -36,7 +36,7 @@ void pyb_usb_dev_init(int usb_dev_type) { // so the memory is invalid after a soft reset (which resets the GC). USBD_Init(&hUSBDDevice, &VCP_Desc, 0); USBD_RegisterClass(&hUSBDDevice, &USBD_CDC); - USBD_CDC_RegisterInterface(&hUSBDDevice, &USBD_CDC_fops); + USBD_CDC_RegisterInterface(&hUSBDDevice, (USBD_CDC_ItfTypeDef*)&USBD_CDC_fops); USBD_Start(&hUSBDDevice); //USBD_Init(&USB_OTG_Core, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_PYB_cb, &USR_cb); break; diff --git a/stmhal/usbd_cdc_interface.c b/stmhal/usbd_cdc_interface.c index e441c0b512..402fba2ce5 100644 --- a/stmhal/usbd_cdc_interface.c +++ b/stmhal/usbd_cdc_interface.c @@ -76,12 +76,11 @@ static void Error_Handler(void); //static void ComPort_Config(void);
static void TIM_Config(void);
-USBD_CDC_ItfTypeDef USBD_CDC_fops =
-{
- CDC_Itf_Init,
- CDC_Itf_DeInit,
- CDC_Itf_Control,
- CDC_Itf_Receive
+const USBD_CDC_ItfTypeDef USBD_CDC_fops = {
+ CDC_Itf_Init,
+ CDC_Itf_DeInit,
+ CDC_Itf_Control,
+ CDC_Itf_Receive
};
/* Private functions ---------------------------------------------------------*/
diff --git a/stmhal/usbd_cdc_interface.h b/stmhal/usbd_cdc_interface.h index 3411893ae9..b50cbf4c29 100644 --- a/stmhal/usbd_cdc_interface.h +++ b/stmhal/usbd_cdc_interface.h @@ -47,7 +47,7 @@ The period depends on USBD_CDC_POLLING_INTERVAL */
#define USBD_CDC_POLLING_INTERVAL 10 /* in ms. The max is 65 and the min is 1 */
-extern USBD_CDC_ItfTypeDef USBD_CDC_fops;
+extern const USBD_CDC_ItfTypeDef USBD_CDC_fops;
void USBD_CDC_SetInterrupt(int chr, void *data);
void USBD_CDC_Tx(const char *str, uint32_t len);
|