diff --git a/lambda/Makefile b/lambda/Makefile index ef23aad..69df61a 100644 --- a/lambda/Makefile +++ b/lambda/Makefile @@ -12,6 +12,9 @@ ## This is where your main() routine lives MAIN = lambda.c +## en: 0 (default), de: 1 +LANG = 0 + ## If you've split your program into multiple .c / .h files, ## include the additional source (in same directory) here LOCAL_SOURCE = usart.c interrupts.c adc.c sensors.c integers.c lcdroutines.c \ @@ -48,7 +51,8 @@ AVRDUDE = avrdude ## Compilation options, type man avr-gcc if you're curious. -CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -DBAUD=$(BAUD) -Os -I. -I$(EXTRA_SOURCE_DIR) +CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -DBAUD=$(BAUD) -DLANG=$(LANG) +CFLAGS += -Os -I. -I$(EXTRA_SOURCE_DIR) CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS += -Wall -Wstrict-prototypes CFLAGS += -g -ggdb diff --git a/lambda/messages.h b/lambda/messages.h index d11056d..fe86ce7 100644 --- a/lambda/messages.h +++ b/lambda/messages.h @@ -8,22 +8,50 @@ #ifndef MESSAGES_H_ #define MESSAGES_H_ -/* lambda.c */ -#define MSG_WELCOME " Hello! " +#ifndef LANG + #define LANG 0 +#endif -/* sensors.c */ -#define MSG_LEAN "Lean " -#define MSG_OKAY "Okay " -#define MSG_IDEAL "Ideal" -#define MSG_RICH "Rich!" +#if LANG == 0 -/* rules.c */ -#define MSG_AIRGATE_50_0 "Air gate 50%" -#define MSG_AIRGATE_25_0 "Air gate 25%" -#define MSG_AIRGATE_CLOSE_0 "Close air gate" -#define MSG_AIRGATE_CLOSE_1 "Turn off heating" -#define MSG_TOO_RICH_0 "Too rich, open" -#define MSG_TOO_RICH_1 "air gate!" -#define MSG_FIRE_OUT_0 "Fire out?" + /* lambda.c */ + #define MSG_WELCOME " Hello! " + + /* sensors.c */ + #define MSG_LEAN "Lean " + #define MSG_OKAY "Okay " + #define MSG_IDEAL "Ideal" + #define MSG_RICH "Rich!" + + /* rules.c */ + #define MSG_AIRGATE_50_0 "Air gate 50%" + #define MSG_AIRGATE_25_0 "Air gate 25%" + #define MSG_AIRGATE_CLOSE_0 "Close air gate" + #define MSG_AIRGATE_CLOSE_1 "Turn off heating" + #define MSG_TOO_RICH_0 "Too rich, open" + #define MSG_TOO_RICH_1 "air gate" + #define MSG_FIRE_OUT_0 "Fire out?" + +#elif LANG == 1 + + /* lambda.c */ + #define MSG_WELCOME " Hallo! " + + /* sensors.c */ + #define MSG_LEAN "Mager" + #define MSG_OKAY "Okay " + #define MSG_IDEAL "Ideal" + #define MSG_RICH "Fett!" + + /* rules.c */ + #define MSG_AIRGATE_50_0 "Luftschieber 50%" + #define MSG_AIRGATE_25_0 "Luftschieber 25%" + #define MSG_AIRGATE_CLOSE_0 "Luftschieber zu" + #define MSG_AIRGATE_CLOSE_1 "Heiz. abschalten" + #define MSG_TOO_RICH_0 "Zu fett, Luft-" + #define MSG_TOO_RICH_1 "schieber oeffnen" + #define MSG_FIRE_OUT_0 "Feuer aus?" + +#endif #endif /* MESSAGES_H_ */