change Serial1 to BT_SERIAL and add debug preprocessor commands to all debug prints to console

This commit is contained in:
Sem van der Hoeven
2024-01-13 16:06:26 +01:00
parent 4708e87685
commit 7099d468d3

View File

@@ -22,6 +22,7 @@ Program to create a car monitor display using:
#define PIN_BT_RX 19
#define PIN_BT_TX 18
#define PIN_BT_STATE 3 /* connected/disconnected state of BT */
#define BT_SERIAL Serial1
#define MS(x) x * 1000
#define S(x) MS(x) * 1000
@@ -150,8 +151,9 @@ void on_init_enter()
Timer3.attachInterrupt(update_ram_kb);
logo_flag |= (1 << FLAG_LOGO_UPDATE);
#if (DEBUG == 1)
Serial.println("Entering init state!");
#endif
}
void on_init_run()
@@ -275,7 +277,9 @@ void on_init_run()
void on_init_exit()
{
#if (DEBUG == 1)
Serial.println("Exiting init state!");
#endif
display.clrScr();
Timer0.detachInterrupt();
Timer0.stop();
@@ -289,13 +293,17 @@ void on_init_exit()
void on_main_enter()
{
#if (DEBUG == 1)
Serial.println("Entering main loop");
#endif
}
void on_main_run()
{
delay(500);
#if (DEBUG == 1)
Serial.println("main!");
#endif
}
void update_init_text()
@@ -338,7 +346,9 @@ void update_device_info()
init_device_info = DEV_RAM;
device_label_i = 0;
Timer3.start(50);
#if (DEBUG == 1)
Serial.println("DEV RAM");
#endif
}
break;
case DEV_RAM:
@@ -421,7 +431,7 @@ void setup()
Serial.begin(9600);
#endif
/* Serial1 is bluetooth module, pin 18 and 19. */
Serial1.begin(115200);
BT_SERIAL.begin(115200);
/* Init display */
display.InitLCD();