Skip to content
Snippets Groups Projects
Commit 195130c1 authored by nrs1g15's avatar nrs1g15
Browse files

Formatted file with CLion and added #if RPM_LEDS_ENABLED around all rpm leds stuff

parent 8bcce354
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define ECU_ATTACHED_ENABLED 1 #define ECU_ATTACHED_ENABLED 1
#define RPM_LEDS_ENABLED 1 #define RPM_LEDS_ENABLED 0
/***************** START OF DEBUG *********************/ /***************** START OF DEBUG *********************/
#define DEBUG_CAN_RX 0 #define DEBUG_CAN_RX 0
...@@ -116,6 +116,10 @@ ...@@ -116,6 +116,10 @@
#if SD_SERIAL_PRINT_BLOCK_WRITES #if SD_SERIAL_PRINT_BLOCK_WRITES
#pragma message "SD Serial Printing Block Writes Info Enabled" #pragma message "SD Serial Printing Block Writes Info Enabled"
#endif //SD_SERIAL_PRINT_BLOCK_WRITES #endif //SD_SERIAL_PRINT_BLOCK_WRITES
#if RPM_LEDS_ENABLED
#pragma message "RPM LEDs Enabled"
#endif //RPM_LEDS_ENABLED
/***************** END OF COMPLIER NOTICES *********************/ /***************** END OF COMPLIER NOTICES *********************/
/***************** START OF SHAFT SPEED *********************/ /***************** START OF SHAFT SPEED *********************/
...@@ -135,7 +139,7 @@ volatile float shaftLastCalcFrequency = 0.0; ...@@ -135,7 +139,7 @@ volatile float shaftLastCalcFrequency = 0.0;
/***************** END OF SHAFT SPEED *********************/ /***************** END OF SHAFT SPEED *********************/
/***************** START OF RPM LEDS **********************/ /***************** START OF RPM LEDS **********************/
#if RPM_LEDS_ENABLE #if RPM_LEDS_ENABLED
#define RPM1_PIN 0 #define RPM1_PIN 0
#define RPM2_PIN 1 #define RPM2_PIN 1
#define RPM3_PIN 2 #define RPM3_PIN 2
...@@ -152,7 +156,8 @@ volatile float shaftLastCalcFrequency = 0.0; ...@@ -152,7 +156,8 @@ volatile float shaftLastCalcFrequency = 0.0;
uint16_t g_RPM = 0; uint16_t g_RPM = 0;
#endif
#endif // RPM_LEDS_ENABLED
/***************** END OF RPM LEDS **********************/ /***************** END OF RPM LEDS **********************/
/***************** START OF SD *********************/ /***************** START OF SD *********************/
#if SD_ENABLED #if SD_ENABLED
...@@ -1147,9 +1152,12 @@ canAddTxRequest(0x2006, data, 8); ...@@ -1147,9 +1152,12 @@ canAddTxRequest(0x2006, data, 8);
} }
ISR(TIMER4_COMPA_vect) { ISR(TIMER4_COMPA_vect) {
#if RPM_LEDS_ENABLED
if (rpmBlueFlashFlag){ if (rpmBlueFlashFlag){
rpmBlueFlashFlag = ~rpmBlueFlashFlag; rpmBlueFlashFlag = ~rpmBlueFlashFlag;
} }
#endif // RPM_LEDS_ENABLED
} }
ISR(TIMER5_COMPA_vect) { ISR(TIMER5_COMPA_vect) {
...@@ -1455,6 +1463,7 @@ uint8_t canTransmitRxToXbee() ...@@ -1455,6 +1463,7 @@ uint8_t canTransmitRxToXbee()
/***************** START OF RPM LED FUNCTIONS *********************/ /***************** START OF RPM LED FUNCTIONS *********************/
/***************** END OF RPM LED FUNCTIONS *********************/ /***************** END OF RPM LED FUNCTIONS *********************/
#if RPM_LEDS_ENABLED
void rpmBegin() { void rpmBegin() {
pinMode(RPM1_PIN, OUTPUT); pinMode(RPM1_PIN, OUTPUT);
...@@ -1464,6 +1473,7 @@ void rpmBegin(){ ...@@ -1464,6 +1473,7 @@ void rpmBegin(){
pinMode(RPM5_PIN, OUTPUT); pinMode(RPM5_PIN, OUTPUT);
timerBegin(4, 4); timerBegin(4, 4);
} }
void rpmProcessLEDS() { void rpmProcessLEDS() {
//Use g_RPM to set LED INDICATORS //Use g_RPM to set LED INDICATORS
//for testing change rpm to tps for testing :) //for testing change rpm to tps for testing :)
...@@ -1528,6 +1538,7 @@ void rpmProcessLEDS(){ ...@@ -1528,6 +1538,7 @@ void rpmProcessLEDS(){
} }
} }
#endif // RPM_LEDS_ENABLED
/***************** START OF ARDUINO FUNCTIONS *********************/ /***************** START OF ARDUINO FUNCTIONS *********************/
void setup() { void setup() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment