diff --git a/src/Makefile b/src/Makefile index e1fcab9db..501deb00f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -179,7 +179,10 @@ EEPROM_PROGRESS_BAR = NO # Values = YES, NO EXTRA_ROTARY_ENCODERS = NO -# DEBUG mode +# Activates the DEBUG Mode (all boards) +# On G9X V4 board, when VOICE=NO: +# PORTH:7 --> Transistion LOW to HIGH = start of setupPulses(). Transistion HIGH to LOW = end of setupPulses(). +# PORTH:6 --> LOW->HIGH = start of mixer calcs. HIGH->LOW, end of mixer calcs. DEBUG = NO # Flight Phases @@ -198,17 +201,6 @@ XCURVES = YES # Values = YES, NO GVARS = NO -#------- TIMING DEBUG OPTIONS ------------------------ - -# Enable debug code to output signals on PORTH for logic analyser timing analysis -# G9X V4 board only. **WARNING** Not compatible with TX_CADDY=YES or SOMO14 (VOICE=YES) -# -# PORTH:7 --> Transistion LOW to HIGH = start of setupPulses(). Transistion HIGH to LOW = end of setupPulses(). -# PORTH:6 --> LOW->HIGH = start of mixer calcs. HIGH->LOW, end of mixer calcs. -# -# Values = YES, NO -PORTH_TIMING=YES - #------- END BUILD OPTIONS --------------------------- # Define programs and commands. @@ -435,8 +427,8 @@ ifeq ($(DEBUG), YES) CPPDEFS += -DDEBUG endif -ifeq ($(PORTH_TIMING), YES) - CPPDEFS += -DPORTH_TIMING +ifeq ($(EEPROM_PROGRESS_BAR), YES) + CPPDEFS += -DEEPROM_PROGRESS_BAR endif ifeq ($(SDCARD), YES) @@ -539,10 +531,6 @@ ifeq ($(PCB), GRUVIN9X) ifeq ($(EXTRA_ROTARY_ENCODERS), YES) CPPDEFS += -DEXTRA_ROTARY_ENCODERS endif - - ifeq ($(EEPROM_PROGRESS_BAR), YES) - CPPDEFS += -DEEPROM_PROGRESS_BAR - endif endif ifeq ($(PCB), STD128) diff --git a/src/board_gruvin9x.cpp b/src/board_gruvin9x.cpp index 553914ac5..f08ef887b 100644 --- a/src/board_gruvin9x.cpp +++ b/src/board_gruvin9x.cpp @@ -45,11 +45,12 @@ inline void board_init() DDRF = 0x00; PORTF = 0x00; // 7-4:JTAG, 3:ADC_REF_1.2V input, 2-0:ADC_SPARE_2-0 DDRG = 0b00010000; PORTG = 0xff; // 7-6:N/A, 5:GearSW, 4: Sim_Ctrl[out], 3:IDL1_Sw, 2:TCut_Sw, 1:RF_Power[in], 0: RudDr_Sw -#ifdef PORTH_TIMING +#if defined(DEBUG) && !defined(VOICE) DDRH = 0b11110000; PORTH = 0b11011111; // PORTH:7-6 enabled for timing analysis output ... see below ... #else DDRH = 0b10110000; PORTH = 0b11011111; // [7:0 DSM/PPM TX-caddy control. 1=PPM, 0=DSM ] - // [6:SOMO14D-BUSY 5:SOMO14D-DATA 4:SOMO14D-CLK] [2:VIB_OPTION -- setting to input for now] + // [6:SOMO14D-BUSY 5:SOMO14D-DATA 4:SOMO14D-CLK] + // [2:VIB_OPTION -- setting to input for now] // [1:TxD 0:RxD Spare serial port] #endif diff --git a/src/open9x.cpp b/src/open9x.cpp index 0d6f9085c..30a830231 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -2996,9 +2996,8 @@ uint16_t getTmr16KHz() #if defined (PCBGRUVIN9X) ISR(TIMER5_COMPA_vect, ISR_NOBLOCK) // mixer interrupt { - -#ifdef PORTH_TIMING - PORTH |= 0x40; // PORTH:6 LOW->HIGH signals start of mixer interrupt +#if defined(DEBUG) && !defined(VOICE) + PORTH |= 0x40; // PORTH:6 LOW->HIGH signals start of mixer interrupt #endif cli(); @@ -3033,10 +3032,9 @@ ISR(TIMER5_COMPA_vect, ISR_NOBLOCK) // mixer interrupt TIMSK5 |= (1<LOW signals end of mixer interrupt #endif - } #endif diff --git a/src/pulses_avr.cpp b/src/pulses_avr.cpp index b073281cb..b4cc3ba44 100644 --- a/src/pulses_avr.cpp +++ b/src/pulses_avr.cpp @@ -730,7 +730,7 @@ void setupPulses() { uint8_t required_protocol = g_model.protocol; -#ifdef PORTH_TIMING +#if defined(PCBGRUVIN9X) && defined(DEBUG) && !defined(VOICE) PORTH |= 0x80; // PORTH:7 LOW->HIGH signals start of setupPulses() #endif @@ -890,10 +890,9 @@ void setupPulses() break; } -#ifdef PORTH_TIMING +#if defined(PCBGRUVIN9X) && defined(DEBUG) && !defined(VOICE) PORTH &= ~0x80; // PORTH:7 HIGH->LOW signals end of setupPulses() #endif - } #ifndef SIMU