diff options
author | Keith Packard <keithp@keithp.com> | 2010-07-14 19:07:02 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-07-14 19:10:04 -0700 |
commit | 695879dbccfc5ec6b79698653c58814158f91686 (patch) | |
tree | 07769c5edf12a993223b6ca439a441c1fddeb8cd /src/ao_dbg.c | |
parent | a9ec6be0e92dee01f7aac006ef6f7779c1da1b36 (diff) |
Switch DBG pins to GPIO when using any debug commands. Reboot to restore.
If you want to use TeleMetrum as a debug dongle, you need to flip the
three pins used to talk to the remote debug port from SPI mode to GPIO
mode.
This patch doesn't provide any way to get back to SPI mode, so you'll
have to reboot the TeleMetrum to write out config parameters or log
flight data after using any debug commands.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_dbg.c')
-rw-r--r-- | src/ao_dbg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ao_dbg.c b/src/ao_dbg.c index e7fbd7ad..0d9ec8c0 100644 --- a/src/ao_dbg.c +++ b/src/ao_dbg.c @@ -164,6 +164,12 @@ ao_dbg_read_byte(void) static void ao_dbg_set_pins(void) { + /* Make the DBG pins GPIOs. On TeleMetrum, this will + * disable the SPI link, so don't expect SPI to work after + * using the debugger. + */ + DBG_PORT_SEL &= ~(DBG_CLOCK|DBG_DATA|DBG_RESET_N); + /* make DBG_DATA tri-state */ DBG_PORT_INP |= DBG_DATA; |