summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-05-27 09:23:37 +0200
committerDaniel Campora <daniel@wipy.io>2015-05-27 09:45:29 +0200
commitd07de2d30768d833992e0bd3147acb24199a66c4 (patch)
tree0e687dd6b5c309eb9899f15f63e168624163f351
parent9414f92fa9675cf2ba27b7700173c690bf7c1f37 (diff)
downloadmicropython-d07de2d30768d833992e0bd3147acb24199a66c4.tar.gz
micropython-d07de2d30768d833992e0bd3147acb24199a66c4.zip
cc3200: Move the STDIO UART pin configuration to mpconfigboard.h.
-rw-r--r--cc3200/README.md2
-rw-r--r--cc3200/boards/LAUNCHXL/mpconfigboard.h4
-rw-r--r--cc3200/mptask.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/cc3200/README.md b/cc3200/README.md
index 733f9913ad..68e9d24751 100644
--- a/cc3200/README.md
+++ b/cc3200/README.md
@@ -29,7 +29,7 @@ make BTARGET=bootloader BTYPE=release
- Make sure the SOP2 jumper is in position.
- Open CCS_Uniflash and connect to the board (by default on port 22).
- Format the serial flash (select 1MB size in case of the CC3200-LAUNCHXL, 2MB in case of the WiPy, leave the rest unchecked).
-- Mark the following files for erasing: `/cert/ca.pem`, `/cert/client.pm`, `/cert/private.key` and `/tmp/pac.bin`.
+- Mark the following files for erasing: `/cert/ca.pem`, `/cert/client.pem`, `/cert/private.key` and `/tmp/pac.bin`.
- Add a new file with the name of /sys/mcuimg.bin, and select the URL to point to cc3200\bootmgr\build\<BOARD_NAME>\bootloader.bin.
- Add another file with the name of /sys/factimg.bin, and select the URL to point to cc3200\build\<BOARD_NAME>\mcuimg.bin.
- Click "Program" to apply all changes.
diff --git a/cc3200/boards/LAUNCHXL/mpconfigboard.h b/cc3200/boards/LAUNCHXL/mpconfigboard.h
index d604062ba9..0dc2caf6a1 100644
--- a/cc3200/boards/LAUNCHXL/mpconfigboard.h
+++ b/cc3200/boards/LAUNCHXL/mpconfigboard.h
@@ -37,6 +37,10 @@
#define MICROPY_STDIO_UART 1
#define MICROPY_STDIO_UART_BAUD 115200
#define MICROPY_STDIO_UART_RX_BUF_SIZE 128
+#define MICROPY_STDIO_UART_TX_PIN (pin_GPIO1)
+#define MICROPY_STDIO_UART_RX_PIN (pin_GPIO2)
+#define MICROPY_STDIO_UART_TX_PIN_AF PIN_MODE_3
+#define MICROPY_STDIO_UART_RX_PIN_AF PIN_MODE_3
#define MICROPY_SYS_LED_PRCM PRCM_GPIOA1
#define MICROPY_SAFE_BOOT_PRCM PRCM_GPIOA2
diff --git a/cc3200/mptask.c b/cc3200/mptask.c
index 174b0cc5a3..621fc3f6c3 100644
--- a/cc3200/mptask.c
+++ b/cc3200/mptask.c
@@ -139,8 +139,8 @@ soft_reset:
#ifdef LAUNCHXL
// configure the stdio uart pins with the correct alternate functions
// param 3 ("mode") is DON'T CARE" for AFs others than GPIO
- pin_config ((pin_obj_t *)&pin_GPIO1, PIN_MODE_3, 0, PIN_TYPE_STD_PU, PIN_STRENGTH_2MA);
- pin_config ((pin_obj_t *)&pin_GPIO2, PIN_MODE_3, 0, PIN_TYPE_STD_PU, PIN_STRENGTH_2MA);
+ pin_config ((pin_obj_t *)&MICROPY_STDIO_UART_TX_PIN, MICROPY_STDIO_UART_TX_PIN_AF, 0, PIN_TYPE_STD_PU, PIN_STRENGTH_2MA);
+ pin_config ((pin_obj_t *)&MICROPY_STDIO_UART_RX_PIN, MICROPY_STDIO_UART_RX_PIN_AF, 0, PIN_TYPE_STD_PU, PIN_STRENGTH_2MA);
// instantiate the stdio uart
mp_obj_t args[2] = {
mp_obj_new_int(MICROPY_STDIO_UART),