summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-02-01 12:44:16 +1100
committerDamien George <damien.p.george@gmail.com>2018-02-01 12:44:16 +1100
commit1d4246a2e8caa52f8381f405bfb37ba24b4246e7 (patch)
tree90d7a376b36dbbc4226b832d9c25e251e3c090b8
parentfed1b4fb56421e8f8a1ee54b2c16296204176bb3 (diff)
stm32/usbdev: Reduce dependency on py header files.
-rw-r--r--ports/stm32/usbd_conf.h2
-rw-r--r--ports/stm32/usbd_desc.c3
-rw-r--r--ports/stm32/usbd_msc_storage.c2
-rw-r--r--ports/stm32/usbdev/class/inc/usbd_cdc_msc_hid.h4
-rw-r--r--ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c1
5 files changed, 5 insertions, 7 deletions
diff --git a/ports/stm32/usbd_conf.h b/ports/stm32/usbd_conf.h
index 34ebe27b9..b066bb2b8 100644
--- a/ports/stm32/usbd_conf.h
+++ b/ports/stm32/usbd_conf.h
@@ -38,8 +38,6 @@
#include <stdlib.h>
#include <string.h>
-#include "py/mpconfig.h"
-
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Common Config */
diff --git a/ports/stm32/usbd_desc.c b/ports/stm32/usbd_desc.c
index 1de75aee0..0c7b2dfe5 100644
--- a/ports/stm32/usbd_desc.c
+++ b/ports/stm32/usbd_desc.c
@@ -33,8 +33,7 @@
#include "usbd_desc.h"
#include "usbd_conf.h"
-// need these headers just for MP_HAL_UNIQUE_ID_ADDRESS
-#include "py/misc.h"
+// need this header just for MP_HAL_UNIQUE_ID_ADDRESS
#include "py/mphal.h"
// So we don't clash with existing ST boards, we use the unofficial FOSS VID.
diff --git a/ports/stm32/usbd_msc_storage.c b/ports/stm32/usbd_msc_storage.c
index f825c3d70..7d6c19e9f 100644
--- a/ports/stm32/usbd_msc_storage.c
+++ b/ports/stm32/usbd_msc_storage.c
@@ -36,7 +36,7 @@
#include "usbd_cdc_msc_hid.h"
#include "usbd_msc_storage.h"
-#include "py/misc.h"
+#include "py/mpstate.h"
#include "storage.h"
#include "sdcard.h"
diff --git a/ports/stm32/usbdev/class/inc/usbd_cdc_msc_hid.h b/ports/stm32/usbdev/class/inc/usbd_cdc_msc_hid.h
index a26b1df0d..c2e7c17fe 100644
--- a/ports/stm32/usbdev/class/inc/usbd_cdc_msc_hid.h
+++ b/ports/stm32/usbdev/class/inc/usbd_cdc_msc_hid.h
@@ -36,8 +36,8 @@ typedef struct {
uint8_t CmdOpCode;
uint8_t CmdLength;
- __IO uint32_t TxState;
- __IO uint32_t RxState;
+ volatile uint32_t TxState;
+ volatile uint32_t RxState;
} USBD_CDC_HandleTypeDef;
typedef struct _USBD_STORAGE {
diff --git a/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c b/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c
index 379a8f32c..81865bc00 100644
--- a/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c
+++ b/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c
@@ -24,6 +24,7 @@
* THE SOFTWARE.
*/
+#include STM32_HAL_H
#include "usbd_ioreq.h"
#include "usbd_cdc_msc_hid.h"