Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae8feac

Browse files
committed
stmhal: Wrap CC3000 driver in MICROPY_HW_ENABLE_CC3K.
This renames MICROPY_HW_HAS_WLAN to MICROPY_HW_ENABLE_CC3K (since it's a driver, not a board feature) and wraps all CC3000 code in this #if. It's disabled for all boards.
1 parent 9c5fc83 commit ae8feac

File tree

17 files changed

+59
-9
lines changed

17 files changed

+59
-9
lines changed

stmhal/boards/NETDUINO_PLUS_2/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define MICROPY_HW_HAS_MMA7660 (0)
1212
#define MICROPY_HW_HAS_LIS3DSH (0)
1313
#define MICROPY_HW_HAS_LCD (0)
14-
#define MICROPY_HW_HAS_WLAN (0)
1514
#define MICROPY_HW_ENABLE_RNG (1)
1615
#define MICROPY_HW_ENABLE_RTC (0)
1716
#define MICROPY_HW_ENABLE_TIMER (1)
@@ -20,6 +19,7 @@
2019
#define MICROPY_HW_ENABLE_I2C1 (0)
2120
#define MICROPY_HW_ENABLE_SPI1 (0)
2221
#define MICROPY_HW_ENABLE_SPI3 (0)
22+
#define MICROPY_HW_ENABLE_CC3K (0)
2323

2424
// USRSW is pulled low. Pressing the button makes the input go high.
2525
#define MICROPY_HW_USRSW_PIN (pin_B11)

stmhal/boards/PYBV10/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define MICROPY_HW_HAS_MMA7660 (1)
88
#define MICROPY_HW_HAS_LIS3DSH (0)
99
#define MICROPY_HW_HAS_LCD (1)
10-
#define MICROPY_HW_HAS_WLAN (1)
1110
#define MICROPY_HW_ENABLE_RNG (1)
1211
#define MICROPY_HW_ENABLE_RTC (1)
1312
#define MICROPY_HW_ENABLE_TIMER (1)
@@ -16,6 +15,7 @@
1615
#define MICROPY_HW_ENABLE_I2C1 (1)
1716
#define MICROPY_HW_ENABLE_SPI1 (1)
1817
#define MICROPY_HW_ENABLE_SPI3 (0)
18+
#define MICROPY_HW_ENABLE_CC3K (0)
1919

2020
// USRSW has no pullup or pulldown, and pressing the switch makes the input go low
2121
#define MICROPY_HW_USRSW_PIN (pin_B3)

stmhal/boards/PYBV3/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define MICROPY_HW_HAS_MMA7660 (1)
88
#define MICROPY_HW_HAS_LIS3DSH (0)
99
#define MICROPY_HW_HAS_LCD (0)
10-
#define MICROPY_HW_HAS_WLAN (0)
1110
#define MICROPY_HW_ENABLE_RNG (1)
1211
#define MICROPY_HW_ENABLE_RTC (1)
1312
#define MICROPY_HW_ENABLE_TIMER (1)
@@ -16,6 +15,7 @@
1615
#define MICROPY_HW_ENABLE_I2C1 (1)
1716
#define MICROPY_HW_ENABLE_SPI1 (1)
1817
#define MICROPY_HW_ENABLE_SPI3 (0)
18+
#define MICROPY_HW_ENABLE_CC3K (0)
1919

2020
// USRSW has no pullup or pulldown, and pressing the switch makes the input go low
2121
#define MICROPY_HW_USRSW_PIN (pin_A13)

stmhal/boards/PYBV4/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define MICROPY_HW_HAS_MMA7660 (1)
88
#define MICROPY_HW_HAS_LIS3DSH (0)
99
#define MICROPY_HW_HAS_LCD (1)
10-
#define MICROPY_HW_HAS_WLAN (0)
1110
#define MICROPY_HW_ENABLE_RNG (1)
1211
#define MICROPY_HW_ENABLE_RTC (1)
1312
#define MICROPY_HW_ENABLE_TIMER (1)
@@ -16,6 +15,7 @@
1615
#define MICROPY_HW_ENABLE_I2C1 (1)
1716
#define MICROPY_HW_ENABLE_SPI1 (1)
1817
#define MICROPY_HW_ENABLE_SPI3 (0)
18+
#define MICROPY_HW_ENABLE_CC3K (0)
1919

2020
// USRSW has no pullup or pulldown, and pressing the switch makes the input go low
2121
#define MICROPY_HW_USRSW_PIN (pin_B3)

stmhal/boards/STM32F4DISC/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define MICROPY_HW_HAS_MMA7660 (0)
88
#define MICROPY_HW_HAS_LIS3DSH (1)
99
#define MICROPY_HW_HAS_LCD (0)
10-
#define MICROPY_HW_HAS_WLAN (0)
1110
#define MICROPY_HW_ENABLE_RNG (1)
1211
#define MICROPY_HW_ENABLE_RTC (1)
1312
#define MICROPY_HW_ENABLE_TIMER (1)
@@ -16,6 +15,7 @@
1615
#define MICROPY_HW_ENABLE_I2C1 (1)
1716
#define MICROPY_HW_ENABLE_SPI1 (1)
1817
#define MICROPY_HW_ENABLE_SPI3 (0)
18+
#define MICROPY_HW_ENABLE_CC3K (0)
1919

2020
// USRSW is pulled low. Pressing the button makes the input go high.
2121
#define MICROPY_HW_USRSW_PIN (pin_A0)

stmhal/cc3k/cc3000_common.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
*
5353
*****************************************************************************/
5454
#include <stdint.h>
55+
#include "mpconfigport.h"
56+
57+
#if MICROPY_HW_ENABLE_CC3K
5558

5659
#include "cc3000_common.h"
5760
#include "socket.h"
@@ -194,3 +197,5 @@ uint32_t STREAM_TO_UINT32_f(char * cp, uint16_t offset)
194197
//! @}
195198
//
196199
//*****************************************************************************
200+
201+
#endif // MICROPY_HW_ENABLE_CC3K

stmhal/cc3k/ccspi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
*****************************************************************************/
4343
#include <stdint.h>
4444
#include <string.h> // for memset
45+
#include "mpconfigport.h"
46+
47+
#if MICROPY_HW_ENABLE_CC3K
4548

4649
#include "ccspi.h"
4750
#include "hci.h"
@@ -735,3 +738,5 @@ void cc3k_int_poll()
735738
SpiIntGPIOHandler();
736739
}
737740
}
741+
742+
#endif // MICROPY_HW_ENABLE_CC3K

stmhal/cc3k/evnt_handler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
//******************************************************************************
5353

5454
#include <stdint.h>
55+
#include "mpconfigport.h"
56+
57+
#if MICROPY_HW_ENABLE_CC3K
5558

5659
#include "cc3000_common.h"
5760
#include "string.h"
@@ -871,3 +874,5 @@ SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from,
871874
//! @}
872875
//
873876
//*****************************************************************************
877+
878+
#endif // MICROPY_HW_ENABLE_CC3K

stmhal/cc3k/hci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050

5151
#include <stdint.h>
5252
#include <string.h> // for memcpy
53+
#include "mpconfigport.h"
54+
55+
#if MICROPY_HW_ENABLE_CC3K
5356

5457
#include "cc3000_common.h"
5558
#include "hci.h"
@@ -240,3 +243,5 @@ hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsi
240243
//
241244
//
242245
//*****************************************************************************
246+
247+
#endif // MICROPY_HW_ENABLE_CC3K

stmhal/cc3k/netapp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
*
4242
*****************************************************************************/
4343
#include <stdint.h>
44+
#include "mpconfigport.h"
45+
46+
#if MICROPY_HW_ENABLE_CC3K
4447

4548
#include "netapp.h"
4649
#include "hci.h"
@@ -475,3 +478,5 @@ long netapp_set_debug_level(unsigned long ulLevel)
475478

476479
}
477480
#endif
481+
482+
#endif // MICROPY_HW_ENABLE_CC3K

0 commit comments

Comments
 (0)