TTS_language defined

tts_cz fixed to play 0.0x numbers correctly
CZ system and custom promts shifted to 260+
This commit is contained in:
mhotar@gmail.com
2012-08-13 20:15:44 +00:00
parent ddfc9f9e17
commit ec1df22130
5 changed files with 37 additions and 6 deletions
+3
View File
@@ -281,6 +281,9 @@ EXTRAINCDIRS = . translations
CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS) CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS)
# TTS language
CPPDEFS += -DTTS_$(TTS)
ifeq ($(UNITS), IMPERIAL) ifeq ($(UNITS), IMPERIAL)
CPPDEFS += -DIMPERIAL_UNITS CPPDEFS += -DIMPERIAL_UNITS
endif endif
+4
View File
@@ -1886,7 +1886,11 @@ void evalFunctions()
if (tmr10ms - s_last_play >= 100) { if (tmr10ms - s_last_play >= 100) {
s_last_play = tmr10ms; s_last_play = tmr10ms;
if (sd->func == FUNC_PLAY_TRACK) if (sd->func == FUNC_PLAY_TRACK)
#if defined(TTS_CZ) && defined(PCBSTD)
putVoiceQueueUpper(PROMPT_CUSTOM_BASE+sd->param);
#else
pushPrompt(PROMPT_CUSTOM_BASE+sd->param); pushPrompt(PROMPT_CUSTOM_BASE+sd->param);
#endif
else else
playValue(sd->param); playValue(sd->param);
} }
+11
View File
@@ -118,6 +118,16 @@ void audioDefevent(uint8_t e);
#define AUDIO_WARNING2() audioDefevent(AU_WARNING2) #define AUDIO_WARNING2() audioDefevent(AU_WARNING2)
#define AUDIO_ERROR() audioDefevent(AU_ERROR) #define AUDIO_ERROR() audioDefevent(AU_ERROR)
#if defined(VOICE) #if defined(VOICE)
#if defined(TTS_CZ) && defined(PCBSTD)
#define AUDIO_TADA() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TADA)
#define AUDIO_TX_BATTERY_LOW() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW)
#define AUDIO_INACTIVITY() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_INACTIVITY)
#define AUDIO_ERROR_MESSAGE(e) putVoiceQueueUpper(PROMPT_SYSTEM_BASE+e)
#define AUDIO_TIMER_30() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_30)
#define AUDIO_TIMER_20() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_20)
#define AUDIO_TIMER_10() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_10)
#define AUDIO_TIMER_LT3(x) putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_LT3)
#else
#define AUDIO_TADA() pushPrompt(PROMPT_SYSTEM_BASE+AU_TADA) #define AUDIO_TADA() pushPrompt(PROMPT_SYSTEM_BASE+AU_TADA)
#define AUDIO_TX_BATTERY_LOW() pushPrompt(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW) #define AUDIO_TX_BATTERY_LOW() pushPrompt(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW)
#define AUDIO_INACTIVITY() pushPrompt(PROMPT_SYSTEM_BASE+AU_INACTIVITY) #define AUDIO_INACTIVITY() pushPrompt(PROMPT_SYSTEM_BASE+AU_INACTIVITY)
@@ -126,6 +136,7 @@ void audioDefevent(uint8_t e);
#define AUDIO_TIMER_20() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_20) #define AUDIO_TIMER_20() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_20)
#define AUDIO_TIMER_10() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_10) #define AUDIO_TIMER_10() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_10)
#define AUDIO_TIMER_LT3(x) pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_LT3) #define AUDIO_TIMER_LT3(x) pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_LT3)
#endif
#else #else
#define AUDIO_TADA() #define AUDIO_TADA()
#define AUDIO_TX_BATTERY_LOW() audioDefevent(AU_TX_BATTERY_LOW) #define AUDIO_TX_BATTERY_LOW() audioDefevent(AU_TX_BATTERY_LOW)
+8 -1
View File
@@ -48,8 +48,13 @@
#define V_WAIT_BUSY_OFF 4 #define V_WAIT_BUSY_OFF 4
#define V_WAIT_BUSY_DELAY 5 #define V_WAIT_BUSY_DELAY 5
#if defined(TTS_CZ) && defined(PCBSTD)
#define PROMPT_SYSTEM_BASE 0
#define PROMPT_CUSTOM_BASE 40
#else
#define PROMPT_SYSTEM_BASE 170 #define PROMPT_SYSTEM_BASE 170
#define PROMPT_CUSTOM_BASE 200 #define PROMPT_CUSTOM_BASE 200
#endif
struct t_voice struct t_voice
{ {
@@ -67,7 +72,9 @@ struct t_voice
void voice_process( void ) ; void voice_process( void ) ;
}; };
#if defined(TTS_CZ)
extern void putVoiceQueueUpper( uint8_t value );
#endif
extern void pushPrompt( uint8_t value ); extern void pushPrompt( uint8_t value );
extern struct t_voice *voiceaddress( void ) ; extern struct t_voice *voiceaddress( void ) ;
extern struct t_voice Voice ; extern struct t_voice Voice ;
+11 -5
View File
@@ -132,11 +132,17 @@ void playNumber(int16_t number, uint8_t unit, uint8_t att)
int8_t mode = MODE(att); int8_t mode = MODE(att);
if (mode > 0) { if (mode > 0) {
div_t qr = div(number, (mode == 1 ? 10 : 100)); div_t qr = div(number, (mode == 1 ? 10 : 100));
playNumber(qr.quot); if (qr.rem) {
pushUnitPrompt(qr.quot,PROMPT_CELA); playNumber(qr.quot);
playNumber(qr.rem,0,ZENSKY); pushUnitPrompt(qr.quot,PROMPT_CELA);
pushPrompt(PROMPT_UNITS_BASE+((unit-1)*4)+3); if (mode != 1 && qr.rem < 10)
pushPrompt (PROMPT_NULA);
playNumber(qr.rem,0,ZENSKY);
pushPrompt(PROMPT_UNITS_BASE+((unit-1)*4)+3);
}
else
playNumber(qr.quot, unit);
return; return;
} }