diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Logger.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Logger.c index edc3d96..aee5565 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Logger.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Logger.c @@ -70,9 +70,13 @@ // Function declarations // ----------------------------------------------------------------------------- +#if defined(ENABLE_LOGGING) static void composeLogQueueItem(struct LogQueueItem* logQueueItem, const char* fileName, const char* functionName, int lineNumber, LogType logType, const char* context); +#endif +#if defined(ENABLE_LOGGING) static void loggerTask(void* parameters); +#endif // ----------------------------------------------------------------------------- // Function definitions @@ -82,7 +86,7 @@ static void loggerTask(void* parameters); ErrorStatus Logger_construct(struct Logger* self, struct IODevice* const device, int taskPriority, uint16_t stackSize) { ErrorStatus returnValue = SUCCESS; - +#if defined(ENABLE_LOGGING) if (!self->initialized) { self->loggingDevice = device; @@ -114,6 +118,7 @@ ErrorStatus Logger_construct(struct Logger* self, struct IODevice* const device, } } +#endif return returnValue; } @@ -196,6 +201,7 @@ void Logger_logISR(struct Logger* self, const char* fileName, const char* functi } +#if defined(ENABLE_LOGGING) static void composeLogQueueItem(struct LogQueueItem* logQueueItem, const char* fileName, const char* functionName, int lineNumber, LogType logType, const char* context) { @@ -230,7 +236,9 @@ static void composeLogQueueItem(struct LogQueueItem* logQueueItem, const char* f logQueueItem->functionName[functionNameSize - 1] = '\0'; } } +#endif +#if defined(ENABLE_LOGGING) static void loggerTask(void* parameters) { struct Logger* self = (struct Logger*)parameters; @@ -297,3 +305,4 @@ static void loggerTask(void* parameters) vTaskDelete(self->taskHandle); } +#endif diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile index faada97..5aab581 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile @@ -8,10 +8,9 @@ RELEASE_PATCH = 4 # Define the platform to use PLATFORM_OLIMEX_STM32_H107 = OLI_STM32_H107 -# Define language possibilities -LANGUAGE_ENGLISH = 0 -LANGUAGE_FRENCH = 1 - +# Language is defined in repairMenu.c +LANG = ENGLISH +export LANGUAGE = -DLANGUAGE=$(LANG) export RELEASE_DEFINES = \ -DRELEASE_PRODUCT=$(RELEASE_PRODUCT) \ @@ -22,18 +21,18 @@ export RELEASE_DEFINES = \ export PLATFORM = -D$(PLATFORM_OLIMEX_STM32_H107) -export LANGUAGE = -DLANGUAGE=$(LANGUAGE_ENGLISH) -# export LANGUAGE = -DLANGUAGE=$(LANGUAGE_FRENCH) - -export ADDITIONAL_SWITCHES = \ --DENABLE_SERIAL_LOGGING BINARY = hsb_mrts_$(PLATFORM_OLIMEX_STM32_H107).bin -all: +all: release + +release: $(MAKE) pho_hsb_olimex_stm32_h107 +debug: export ADDITIONAL_SWITCHES = -DENABLE_SERIAL_LOGGING -DENABLE_HW_VALIDATION +debug: + $(MAKE) pho_hsb_olimex_stm32_h107 pho_hsb_olimex_stm32_h107: @echo ------------------------------------------ @@ -43,15 +42,6 @@ pho_hsb_olimex_stm32_h107: $(MAKE) -C Platform $(MAKE) -C HAL $(MAKE) -C hsb-mrts - -flash: - openocd -f /usr/share/openocd/scripts/board/stm32f1discovery.cfg \ - -c "init" \ - -c "reset halt" \ - -c "flash write_image erase $(BINARY) 0x08000000" \ - -c "verify_image $(BINARY) 0x08000000" \ - -c "reset run" \ - -c "shutdown" clean: diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt index 69f64a4..94a7e51 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt @@ -8,4 +8,5 @@ FIXED - PIN change verification not functional - Multi-Language support added to menu. All strings/messages outsourced to dedicated file. MakeFile adapted - NumberOfStages Macro for presets not implemented well. It will be ignored when generating DEFAULT presets -- HW validation menu outdated/unfunctional \ No newline at end of file +- HW validation menu outdated/unfunctional +- Fixed Makefile switches for debug/release and languages \ No newline at end of file diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile index 25a5ed5..95bb840 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile @@ -76,7 +76,7 @@ OLI_STM32_H107: export OBJ_DIR := obj_release/ OLI_STM32_H107: export OBJECTS := $(OBJECTS_GEN) OLI_STM32_H107: export OBJECTS_MAIN := $(OBJECTS_MAIN) OLI_STM32_H107: export CROSS_COMPILE := arm-none-eabi- -OLI_STM32_H107: export CCFLAGS := -c -O2 -Wall -Werror -g -lc -lm -fno-common -mcpu=cortex-m3 -mthumb $(PLATFORM) $(RELEASE_DEFINES) $(LANGUAGE) $(INCLUDES) +OLI_STM32_H107: export CCFLAGS := -c -O2 -Wall -Werror -g -lc -lm -fno-common -mcpu=cortex-m3 -mthumb $(PLATFORM) $(RELEASE_DEFINES) $(LANGUAGE) $(INCLUDES) $(ADDITIONAL_SWITCHES) OLI_STM32_H107: export ASFLAGS := -g -mapcs-32 OLI_STM32_H107: export LDFLAGS := -g -nostartfiles -mcpu=cortex-m3 -mthumb -T$(LINKER_SCRIPTS_DIR)/$(LINKER_SCRIPT) -Wl,-Map=hsb_mrts_OLI_STM32_H107.map OLI_STM32_H107: export LDARCHIVES := -L. -L$(STM32_STDPERIPH_ROOT) -L$(PLATFORM_DIR) -L$(HAL_DIR) -lhsb_mrts_OLI_STM32_H107 -lPlatform -lHAL -lSTM_StdPeriph diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c index 322d9df..f073c01 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c @@ -92,9 +92,11 @@ static xTaskHandle initTaskHandle; static xTaskHandle ledTaskHandle; static xTaskHandle sysTaskHandle; +#ifdef ENABLE_HW_VALIDATION static struct HwValidationMenu _hwValidation = {.initialized = false}; static struct HwValidationMenuItems hwTestItems; struct HwValidationMenu* hwValidation = &_hwValidation; +#endif static struct CachedStorage cs = {.initialized = false}; static struct CachedStorage deviceParameters = {.initialized = false}; @@ -110,7 +112,7 @@ static void ledBlinkTask(void* parameters); // Function definitions // ----------------------------------------------------------------------------- - + int main (void) { @@ -228,6 +230,7 @@ static void initTask(void* parameters) RepairPresets_construct(&cs, &iFlash->memoryDevice); } +#ifdef ENABLE_HW_VALIDATION if (returnValue == SUCCESS) { hwTestItems.display = &nhd0420->displayDevice; @@ -249,7 +252,7 @@ static void initTask(void* parameters) // EEPROM TO BE DONE HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 1, 1024); } - +#endif if (returnValue == SUCCESS) { // Create task that repeats to print out TASK information on the logger diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c index f5a6023..313f59e 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c @@ -70,6 +70,8 @@ #define REPAIRMENU_POPUPSCREEN_TIME_MS (1000) +#define ENGLISH (0) +#define FRENCH (1) #ifdef LANGUAGE #if ((LANGUAGE >= MENUTEXT_NUMBER_OF_LANGUAGES) || (LANGUAGE < 0))