removed feature-defines for CAN and Websockets

This commit is contained in:
2023-12-25 00:44:24 +01:00
parent e8a93a600e
commit 3d7e798310
10 changed files with 27 additions and 67 deletions

View File

@@ -18,12 +18,8 @@
#include "config.h"
#include "globals.h"
#include "debugger.h"
#ifdef FEATURE_ENABLE_CAN
#include "can.h"
#endif
#ifdef FEATURE_ENABLE_GPS
#include "gps.h"
#endif
#include "dtc.h"
#include "led_colors.h"
@@ -99,20 +95,24 @@ void setup()
leds.begin();
Serial.print("\nLED-Init done");
pinMode(GPIO_TRIGGER, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(GPIO_TRIGGER), trigger_ISR, FALLING);
Serial.print("\nPulse-Input Init done");
#ifdef FEATURE_ENABLE_GPS
Init_GPS();
Serial.print("\nGPS-Init done");
#endif
#ifdef FEATURE_ENABLE_CAN
if (LubeConfig.SpeedSource != SOURCE_IMPULSE)
switch (LubeConfig.SpeedSource)
{
case SOURCE_CAN:
Init_CAN();
Serial.print("\nCAN-Init done");
break;
case SOURCE_GPS:
Init_GPS();
Serial.print("\nGPS-Init done");
break;
case SOURCE_IMPULSE:
pinMode(GPIO_TRIGGER, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(GPIO_TRIGGER), trigger_ISR, FALLING);
Serial.print("\nPulse-Input Init done");
break;
default:
break;
}
#endif
Serial.print("\nSource-Init done");
pinMode(GPIO_BUTTON, INPUT_PULLUP);
@@ -167,32 +167,27 @@ void loop()
case SOURCE_IMPULSE:
wheelDistance = Process_Impulse_WheelSpeed();
break;
#ifdef FEATURE_ENABLE_CAN
case SOURCE_CAN:
wheelDistance = Process_CAN_WheelSpeed();
break;
#endif
#ifdef FEATURE_ENABLE_TIMER
case SOURCE_TIME:
break;
#endif
#ifdef FEATURE_ENABLE_GPS
case SOURCE_GPS:
wheelDistance = Process_GPS_WheelSpeed();
break;
#endif
}
RunLubeApp(wheelDistance);
#ifdef FEATURE_ENABLE_OLED
Display_Process();
#endif
#ifdef FEATURE_ENABLE_CAN
if (LubeConfig.SpeedSource != SOURCE_IMPULSE)
{
CAN_Process();
}
#endif
Button_Process();
LED_Process();
EEPROM_Process();