Skip to content

Commit 11935fd

Browse files
committed
add gdbstub support
I2S cannot be used with GDB because it occupies the RX pin.
1 parent 3a46271 commit 11935fd

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

ttbasic/nosdki2s.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "ttconfig.h"
12
#include "nosdki2s.h"
23
#ifdef ESP8266_NOWIFI
34
#include <hw/pin_mux_register.h>
@@ -47,6 +48,7 @@ volatile int isrs = 0;
4748
volatile uint32_t *nosdk_i2s_curr_buf;
4849
volatile uint32_t nosdk_i2s_curr_buf_pos;
4950

51+
#ifndef ENABLE_GDBSTUB
5052
LOCAL ICACHE_RAM_ATTR void slc_isr(void) {
5153
struct sdio_queue *finished;
5254
SLC_INT_CLRL = 0xffffffff;
@@ -57,6 +59,7 @@ LOCAL ICACHE_RAM_ATTR void slc_isr(void) {
5759

5860
isrs++;
5961
}
62+
#endif
6063

6164
#endif
6265

@@ -80,6 +83,9 @@ void nosdk_i2s_clear_buf()
8083

8184
void InitI2S()
8285
{
86+
#ifdef ENABLE_GDBSTUB
87+
return;
88+
#else
8389
DR_REG_SLC_BASEL[4] = 0; //Reset DMA
8490
SLC_CONF0L = (1<<SLC_MODE_S); //Configure DMA
8591
SLC_RX_DSCR_CONFL = SLC_INFOR_NO_REPLACE|SLC_TOKEN_NO_REPLACE;
@@ -137,6 +143,7 @@ void InitI2S()
137143

138144
//Start transmission
139145
I2SCONFL |= I2S_I2S_TX_START;
146+
#endif // ENABLE_GDBSTUB
140147
}
141148

142149
void SendI2S()

ttbasic/ttbasic.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include "ttconfig.h"
88
#include "lock.h"
99

10+
#ifdef ENABLE_GDBSTUB
11+
#include <GDBStub.h>
12+
#endif
13+
1014
#ifdef HAVE_PROFILE
1115
void NOINS setup(void);
1216
void NOINS loop(void);

ttbasic/ttconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
#define NOINS __attribute__((no_instrument_function))
7070
#endif
7171

72+
//#define ENABLE_GDBSTUB
73+
7274
#include "ati_6x8.h"
7375
#include "amstrad_8x8.h"
7476
#include "cbm_ascii_8x8.h"

0 commit comments

Comments
 (0)