diff options
author | Keith Packard <keithp@keithp.com> | 2014-11-06 16:04:56 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-11-06 16:04:56 -0800 |
commit | 6a082d9b5ed169b9d4153885f3535987e5ae5d84 (patch) | |
tree | 54f823510473dd415abe0d22da3c6ec1ba7530ab /src/lpc/ao_led_lpc.c | |
parent | 58db263cc835be0abb972654c2d7369718c88b37 (diff) |
altos/lpc: Disable JTAG when using pins for GPIO
JTAG is enabled by default, making those pins not support GPIO unless
specifically configured.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lpc/ao_led_lpc.c')
-rw-r--r-- | src/lpc/ao_led_lpc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lpc/ao_led_lpc.c b/src/lpc/ao_led_lpc.c index d983437c..a0b293b9 100644 --- a/src/lpc/ao_led_lpc.c +++ b/src/lpc/ao_led_lpc.c @@ -59,6 +59,15 @@ void ao_led_init(AO_PORT_TYPE enable) { ao_led_enable = enable; - lpc_scb.sysahbclkctrl |= (1 << LPC_SCB_SYSAHBCLKCTRL_GPIO); + ao_enable_port(LED_PORT); + if (LED_PORT == 0) { + if (enable & (1 << 11)) + lpc_ioconf.pio0_11 = LPC_IOCONF_FUNC_PIO0_11 | (1 << LPC_IOCONF_ADMODE); + if (enable & (1 << 12)) + lpc_ioconf.pio0_12 = LPC_IOCONF_FUNC_PIO0_12 | (1 << LPC_IOCONF_ADMODE); + if (enable & (1 << 14)) + lpc_ioconf.pio0_14 = LPC_IOCONF_FUNC_PIO0_14 | (1 << LPC_IOCONF_ADMODE); + } lpc_gpio.dir[LED_PORT] |= enable; + ao_led_off(enable); } |