better guards

This commit is contained in:
Andrey 2024-03-15 19:04:46 -06:00
parent 1e32c86cbb
commit cc161fb029
4 changed files with 12 additions and 8 deletions

View File

@ -47,7 +47,7 @@ static void sayHello() {
efiPrintf(PROTOCOL_HELLO_PREFIX " Chibios Kernel: %s", CH_KERNEL_VERSION); efiPrintf(PROTOCOL_HELLO_PREFIX " Chibios Kernel: %s", CH_KERNEL_VERSION);
efiPrintf(PROTOCOL_HELLO_PREFIX " Compiled: " __DATE__ " - " __TIME__ ""); efiPrintf(PROTOCOL_HELLO_PREFIX " Compiled: " __DATE__ " - " __TIME__ "");
efiPrintf(PROTOCOL_HELLO_PREFIX " COMPILER=%s", __VERSION__); efiPrintf(PROTOCOL_HELLO_PREFIX " COMPILER=%s", __VERSION__);
#if USE_OPENBLT #if EFI_USE_OPENBLT
efiPrintf(PROTOCOL_HELLO_PREFIX " with OPENBLT"); efiPrintf(PROTOCOL_HELLO_PREFIX " with OPENBLT");
#endif #endif

View File

@ -103,6 +103,7 @@ static void printRusefiVersion(const char *engineTypeName, const char *firmwareB
getTimeNowS()); getTimeNowS());
} }
#if EFI_PROD_CODE
// Inform the console about the mapping between a pin's logical name (for example, injector 3) // Inform the console about the mapping between a pin's logical name (for example, injector 3)
// and the physical MCU pin backing that function (for example, PE3) // and the physical MCU pin backing that function (for example, PE3)
static void printOutPin(const char *pinName, brain_pin_e hwPin) { static void printOutPin(const char *pinName, brain_pin_e hwPin) {
@ -118,6 +119,7 @@ static void printOutPin(const char *pinName, brain_pin_e hwPin) {
efiPrintfProto(PROTOCOL_OUTPIN, "%s@%s", pinName, hwPinName); efiPrintfProto(PROTOCOL_OUTPIN, "%s@%s", pinName, hwPinName);
} }
#endif // EFI_PROD_CODE
// Print out the current mapping between logical and physical pins that // Print out the current mapping between logical and physical pins that
// the engine sniffer cares about, so we can display a physical pin // the engine sniffer cares about, so we can display a physical pin
@ -225,8 +227,10 @@ static systime_t timeOfPreviousReport = (systime_t) -1;
#endif /* EFI_LOGIC_ANALYZER */ #endif /* EFI_LOGIC_ANALYZER */
} }
#if EFI_PROD_CODE
static OutputPin* leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin, static OutputPin* leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin,
&enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin }; &enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin };
#endif // EFI_PROD_CODE
void initWarningRunningPins() { void initWarningRunningPins() {
#if EFI_PROD_CODE #if EFI_PROD_CODE

View File

@ -457,7 +457,7 @@ static void handleCommandX14(uint16_t index) {
#endif #endif
return; return;
case TS_RESET_MC33810: case TS_RESET_MC33810:
#if (BOARD_MC33810_COUNT > 0) #if EFI_PROD_CODE && (BOARD_MC33810_COUNT > 0)
mc33810_req_init(); mc33810_req_init();
#endif #endif
return; return;
@ -609,7 +609,7 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) {
break; break;
case 0xba: case 0xba:
#if EFI_DFU_JUMP #if EFI_PROD_CODE && EFI_DFU_JUMP
jump_to_bootloader(); jump_to_bootloader();
#endif /* EFI_DFU_JUMP */ #endif /* EFI_DFU_JUMP */
break; break;

View File

@ -22,14 +22,14 @@
static bool fs_ready = false; static bool fs_ready = false;
#if EFI_PROD_CODE
int totalLoggedBytes = 0; int totalLoggedBytes = 0;
static int fileCreatedCounter = 0; static int fileCreatedCounter = 0;
static int writeCounter = 0; static int writeCounter = 0;
static int totalWritesCounter = 0; static int totalWritesCounter = 0;
static int totalSyncCounter = 0; static int totalSyncCounter = 0;
#if EFI_PROD_CODE
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "mmc_card.h" #include "mmc_card.h"