[9x stock] Issue 7 fixed.
[9x stock / gruvin9x] All prompts renumbered!
This commit is contained in:
+1
-1
@@ -199,7 +199,7 @@ void audioStart();
|
||||
extern void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id)
|
||||
#define PUSH_PROMPT(p) pushPrompt((p), id)
|
||||
#define PUSH_NUMBER_PROMPT(p) pushPrompt((p), id)
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a), id)
|
||||
#define PLAY_DURATION(d) playDuration((d), id)
|
||||
#define IS_PLAYING(id) audioQueue.isPlaying((id))
|
||||
|
||||
+2
-5
@@ -40,6 +40,7 @@ audioQueue::audioQueue()
|
||||
{
|
||||
toneTimeLeft = 0;
|
||||
tonePause = 0;
|
||||
tone2TimeLeft = 0;
|
||||
|
||||
t_queueRidx = 0;
|
||||
t_queueWidx = 0;
|
||||
@@ -66,7 +67,6 @@ void audioQueue::heartbeat()
|
||||
}
|
||||
#endif
|
||||
toneFreq += toneFreqIncr;
|
||||
// TODO tone2TimeLeft = 0?
|
||||
}
|
||||
toneTimeLeft--; //time gets counted down
|
||||
}
|
||||
@@ -98,9 +98,6 @@ void audioQueue::heartbeat()
|
||||
}
|
||||
else {
|
||||
SPEAKER_OFF;
|
||||
if (tone2Pause > 0) {
|
||||
tone2Pause--; //time gets counted down
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +126,6 @@ void audioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlag
|
||||
if (tFlags & PLAY_BACKGROUND) {
|
||||
tone2Freq = tFreq;
|
||||
tone2TimeLeft = tLen;
|
||||
tone2Pause = tPause;
|
||||
}
|
||||
else {
|
||||
int8_t tFreqIncr = (tFlags >> 6);
|
||||
@@ -178,6 +174,7 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
|
||||
if (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && e>=AU_TRIM_MOVE) || (g_eeGeneral.beeperMode>=-1 && e<=AU_ERROR)) {
|
||||
if (e < AU_FRSKY_FIRST || empty()) {
|
||||
// TODO when VOICE enable some cases here are not needed!
|
||||
switch (e) {
|
||||
// inactivity timer alert
|
||||
case AU_INACTIVITY:
|
||||
|
||||
+8
-9
@@ -95,7 +95,6 @@ class audioQueue
|
||||
// vario has less priority
|
||||
uint8_t tone2Freq;
|
||||
uint8_t tone2TimeLeft;
|
||||
uint8_t tone2Pause;
|
||||
|
||||
// queue arrays
|
||||
uint8_t queueToneFreq[AUDIO_QUEUE_LENGTH];
|
||||
@@ -121,15 +120,15 @@ void audioDefevent(uint8_t e);
|
||||
#define AUDIO_ERROR() audioDefevent(AU_ERROR)
|
||||
|
||||
#if defined(VOICE)
|
||||
#define AUDIO_TADA() pushPrompt(PROMPT_SYSTEM_BASE+AU_TADA)
|
||||
#define AUDIO_TX_BATTERY_LOW() pushPrompt(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_INACTIVITY() pushPrompt(PROMPT_SYSTEM_BASE+AU_INACTIVITY)
|
||||
#define AUDIO_ERROR_MESSAGE(e) pushPrompt(PROMPT_SYSTEM_BASE+(e))
|
||||
#define AUDIO_TADA() PUSH_SYSTEM_PROMPT(AU_TADA)
|
||||
#define AUDIO_TX_BATTERY_LOW() PUSH_SYSTEM_PROMPT(AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_INACTIVITY() PUSH_SYSTEM_PROMPT(AU_INACTIVITY)
|
||||
#define AUDIO_ERROR_MESSAGE(e) PUSH_SYSTEM_PROMPT((e))
|
||||
#define AUDIO_TIMER_MINUTE(t) playDuration(t)
|
||||
#define AUDIO_TIMER_30() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_30)
|
||||
#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_LT3(x) pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_LT3)
|
||||
#define AUDIO_TIMER_30() PUSH_SYSTEM_PROMPT(AU_TIMER_30)
|
||||
#define AUDIO_TIMER_20() PUSH_SYSTEM_PROMPT(AU_TIMER_20)
|
||||
#define AUDIO_TIMER_10() PUSH_SYSTEM_PROMPT(AU_TIMER_10)
|
||||
#define AUDIO_TIMER_LT3(x) PUSH_SYSTEM_PROMPT(AU_TIMER_LT3)
|
||||
#else
|
||||
#define AUDIO_TADA()
|
||||
#define AUDIO_TX_BATTERY_LOW() audioDefevent(AU_TX_BATTERY_LOW)
|
||||
|
||||
+22
-9
@@ -61,21 +61,34 @@ inline void _beep(uint8_t b)
|
||||
|
||||
extern void beep(uint8_t val);
|
||||
|
||||
#define AUDIO_TADA()
|
||||
#if defined(VOICE)
|
||||
#define AUDIO_TADA() PUSH_SYSTEM_PROMPT(AU_TADA)
|
||||
#define AUDIO_TX_BATTERY_LOW() PUSH_SYSTEM_PROMPT(AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_INACTIVITY() PUSH_SYSTEM_PROMPT(AU_INACTIVITY)
|
||||
#define AUDIO_ERROR_MESSAGE(e) PUSH_SYSTEM_PROMPT((e))
|
||||
#define AUDIO_TIMER_MINUTE(t) playDuration(t)
|
||||
#define AUDIO_TIMER_30() PUSH_SYSTEM_PROMPT(AU_TIMER_30)
|
||||
#define AUDIO_TIMER_20() PUSH_SYSTEM_PROMPT(AU_TIMER_20)
|
||||
#define AUDIO_TIMER_10() PUSH_SYSTEM_PROMPT(AU_TIMER_10)
|
||||
#define AUDIO_TIMER_LT3(x) PUSH_SYSTEM_PROMPT(AU_TIMER_LT3)
|
||||
#else
|
||||
#define AUDIO_TADA()
|
||||
#define AUDIO_TX_BATTERY_LOW() beep(4)
|
||||
#define AUDIO_INACTIVITY() beep(3)
|
||||
#define AUDIO_ERROR_MESSAGE(e) beep(4)
|
||||
#define AUDIO_TIMER_MINUTE(t) beep(2)
|
||||
#define AUDIO_TIMER_30() { beepAgain=2; beep(2); }
|
||||
#define AUDIO_TIMER_20() { beepAgain=1; beep(2); }
|
||||
#define AUDIO_TIMER_10() beep(2)
|
||||
#define AUDIO_TIMER_LT3(x) beep(2)
|
||||
#endif
|
||||
|
||||
#define AUDIO_KEYPAD_UP() beep(0)
|
||||
#define AUDIO_KEYPAD_DOWN() beep(0)
|
||||
#define AUDIO_MENUS() beep(0)
|
||||
#define AUDIO_WARNING2() beep(2)
|
||||
#define AUDIO_WARNING1() beep(3)
|
||||
#define AUDIO_TX_BATTERY_LOW() beep(4)
|
||||
#define AUDIO_ERROR() beep(4)
|
||||
#define AUDIO_ERROR_MESSAGE(e) beep(4)
|
||||
#define AUDIO_TIMER_MINUTE(t) beep(2)
|
||||
#define AUDIO_TIMER_30() { beepAgain=2; beep(2); }
|
||||
#define AUDIO_TIMER_20() { beepAgain=1; beep(2); }
|
||||
#define AUDIO_TIMER_10() beep(2)
|
||||
#define AUDIO_TIMER_LT3(x) beep(2)
|
||||
#define AUDIO_INACTIVITY() beep(3)
|
||||
#define AUDIO_MIX_WARNING(x) beep(1)
|
||||
#define AUDIO_POT_STICK_MIDDLE() beep(2)
|
||||
#define AUDIO_VARIO_UP() _beep(1)
|
||||
|
||||
@@ -34,15 +34,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define PROMPT_SYSTEM_BASE 230
|
||||
#define PROMPT_CUSTOM_BASE 256
|
||||
#define PROMPT_CUSTOM_BASE 0
|
||||
#define PROMPT_I18N_BASE 256
|
||||
#define PROMPT_SYSTEM_BASE 480
|
||||
|
||||
extern void pushPrompt(uint16_t prompt);
|
||||
extern bool isPlaying();
|
||||
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__)
|
||||
#define PUSH_PROMPT(p) pushPrompt((p))
|
||||
#define PUSH_CUSTOM_PROMPT(p, id) pushPrompt(PROMPT_CUSTOM_BASE+(p))
|
||||
#define PUSH_NUMBER_PROMPT(p) pushPrompt(PROMPT_I18N_BASE+(p))
|
||||
#define PUSH_SYSTEM_PROMPT(p) pushPrompt(PROMPT_SYSTEM_BASE+(p))
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a))
|
||||
#define PLAY_DURATION(d) playDuration((d))
|
||||
#define IS_PLAYING(id) isPlaying()
|
||||
|
||||
+16
-9
@@ -63,7 +63,7 @@ void evalVario(int16_t altitude_bp, uint16_t altitude_ap)
|
||||
{
|
||||
int32_t varioAltitude_cm = (int32_t)altitude_bp * 100 + (altitude_bp > 0 ? altitude_ap : -altitude_ap);
|
||||
uint8_t varioAltitudeQueuePointer = frskyData.hub.varioAltitudeQueuePointer + 1;
|
||||
if (varioAltitudeQueuePointer == VARIO_QUEUE_LENGTH)
|
||||
if (varioAltitudeQueuePointer >= VARIO_QUEUE_LENGTH)
|
||||
varioAltitudeQueuePointer = 0;
|
||||
frskyData.hub.varioAltitudeQueuePointer = varioAltitudeQueuePointer;
|
||||
frskyData.hub.varioSpeed -= frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] ;
|
||||
@@ -123,22 +123,27 @@ void getGpsDistance()
|
||||
#if defined(FRSKY) && defined(VARIO)
|
||||
void varioWakeup()
|
||||
{
|
||||
static uint16_t s_varioTmr = 0;
|
||||
static tmr10ms_t s_varioTmr;
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
|
||||
if (isFunctionActive(FUNC_VARIO)) {
|
||||
#if defined(AUDIO)
|
||||
// conversion in cm/s
|
||||
int16_t verticalSpeed;
|
||||
cli();
|
||||
int16_t verticalSpeed = frskyData.hub.varioSpeed;
|
||||
sei();
|
||||
|
||||
int16_t varioCenterMax = (int16_t)g_model.frsky.varioCenterMax * 10 + 50;
|
||||
if (frskyData.hub.varioSpeed >= varioCenterMax) {
|
||||
verticalSpeed = frskyData.hub.varioSpeed - varioCenterMax;
|
||||
if (verticalSpeed >= varioCenterMax) {
|
||||
verticalSpeed = verticalSpeed - varioCenterMax;
|
||||
int16_t varioMax = (10+(int16_t)g_model.frsky.varioMax) * 100;
|
||||
if (verticalSpeed > varioMax) verticalSpeed = varioMax;
|
||||
verticalSpeed = (verticalSpeed * 10) / ((varioMax-varioCenterMax) / 100);
|
||||
}
|
||||
else {
|
||||
int16_t varioCenterMin = (int16_t)g_model.frsky.varioCenterMin * 10 - 50;
|
||||
if (frskyData.hub.varioSpeed <= varioCenterMin) {
|
||||
verticalSpeed = frskyData.hub.varioSpeed - varioCenterMin;
|
||||
if (verticalSpeed <= varioCenterMin) {
|
||||
verticalSpeed = verticalSpeed - varioCenterMin;
|
||||
int16_t varioMin = (-10+(int16_t)g_model.frsky.varioMin) * 100;
|
||||
if (verticalSpeed < varioMin) verticalSpeed = varioMin;
|
||||
verticalSpeed = (verticalSpeed * 10) / ((varioCenterMin-varioMin) / 100);
|
||||
@@ -148,8 +153,7 @@ void varioWakeup()
|
||||
}
|
||||
}
|
||||
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
if (verticalSpeed < 0 || tmr10ms > s_varioTmr) {
|
||||
if (verticalSpeed < 0 || (int16_t)(s_varioTmr-tmr10ms) < 0) {
|
||||
uint8_t SoundVarioBeepTime = (1600 - verticalSpeed) / 100;
|
||||
#if defined(CPUARM)
|
||||
uint8_t SoundVarioBeepFreq = (verticalSpeed * 10 + 16000) >> 7;
|
||||
@@ -184,5 +188,8 @@ void varioWakeup()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
s_varioTmr = tmr10ms;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -129,9 +129,10 @@ bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen,
|
||||
#endif
|
||||
|
||||
static uint16_t s_last_menu_offset = 0;
|
||||
static uint8_t s_last_flags;
|
||||
|
||||
#if defined(CPUARM)
|
||||
static uint8_t s_last_flags;
|
||||
|
||||
if (selection) {
|
||||
s_last_flags = flags;
|
||||
memset(reusableBuffer.models.menu_bss, 0, sizeof(reusableBuffer.models.menu_bss));
|
||||
|
||||
+1
-1
@@ -3783,7 +3783,7 @@ void saveTimers()
|
||||
{
|
||||
for (uint8_t i=0; i<MAX_TIMERS; i++) {
|
||||
if (g_model.timers[i].persistent) {
|
||||
if (g_model.timers[i].value != s_timerVal[i]) {
|
||||
if (g_model.timers[i].value != (uint16_t)s_timerVal[i]) {
|
||||
g_model.timers[i].value = s_timerVal[i];
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
@@ -105,14 +105,14 @@ inline void boardInit()
|
||||
DDRF = 0x00; PORTF = 0x00; //anain
|
||||
DDRG = 0x14; PORTG = 0xfb; //pullups + SIM_CTL=1 = phonejack = ppm_in, Haptic output and off (0)
|
||||
|
||||
ADMUX=ADC_VREF_TYPE;
|
||||
ADCSRA=0x85; // ADC enabled, pre-scaler division=32 (no interrupt, no auto-triggering)
|
||||
ADMUX = ADC_VREF_TYPE;
|
||||
ADCSRA = 0x85; // ADC enabled, pre-scaler division=32 (no interrupt, no auto-triggering)
|
||||
|
||||
// TCNT0 10ms = 16MHz/1024/156 periodic timer (9.984ms)
|
||||
// (with 1:4 duty at 157 to average 10.0ms)
|
||||
// Timer overflows at about 61Hz or once every 16ms.
|
||||
TCCR0 = (0b111 << CS00); // Norm mode, clk/1024
|
||||
OCR0 = 156;
|
||||
OCR0 = 156;
|
||||
|
||||
#if defined(AUDIO) || defined(VOICE)
|
||||
TCCR2 = (0b010 << CS00); // Norm mode, clk/8
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
|
||||
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
|
||||
|
||||
#define TIMER_16KHZ_VECT TIMER0_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT0
|
||||
#define TIMER_16KHZ_VECT TIMER0_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT0
|
||||
|
||||
#define TIMER_10MS_VECT TIMER0_COMP_vect
|
||||
#define TIMER_10MS_COMPVAL OCR0
|
||||
|
||||
+5
-5
@@ -38,7 +38,7 @@
|
||||
|
||||
struct t_voice Voice ;
|
||||
|
||||
void pushPrompt16(uint16_t value)
|
||||
void pushPrompt(uint16_t value)
|
||||
{
|
||||
#ifdef SIMU
|
||||
printf("playFile(\"%04d.ad4\")\n", value); fflush(stdout);
|
||||
@@ -49,19 +49,19 @@ void pushPrompt16(uint16_t value)
|
||||
|
||||
if (vptr->VoiceQueueCount < VOICE_Q_LENGTH) {
|
||||
vptr->VoiceQueue[vptr->VoiceQueueInIndex++] = value;
|
||||
vptr->VoiceQueueInIndex &= (VOICE_Q_LENGTH - 1); // TODO flash saving?
|
||||
vptr->VoiceQueueInIndex &= (VOICE_Q_LENGTH - 1);
|
||||
vptr->VoiceQueueCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void pushCustomPrompt(uint8_t value)
|
||||
{
|
||||
pushPrompt16(PROMPT_CUSTOM_BASE + value);
|
||||
pushPrompt(PROMPT_CUSTOM_BASE + value);
|
||||
}
|
||||
|
||||
void pushPrompt(uint8_t value)
|
||||
void pushNumberPrompt(uint8_t value)
|
||||
{
|
||||
pushPrompt16(value);
|
||||
pushPrompt(PROMPT_I18N_BASE + value);
|
||||
}
|
||||
|
||||
struct t_voice *voiceaddress()
|
||||
|
||||
+17
-21
@@ -56,8 +56,9 @@
|
||||
#define V_WAIT_BUSY_DELAY 5
|
||||
#define V_WAIT_START_BUSY_OFF 6
|
||||
|
||||
#define PROMPT_SYSTEM_BASE 230
|
||||
#define PROMPT_CUSTOM_BASE 256
|
||||
#define PROMPT_CUSTOM_BASE 0
|
||||
#define PROMPT_I18N_BASE 256
|
||||
#define PROMPT_SYSTEM_BASE 480
|
||||
|
||||
struct t_voice
|
||||
{
|
||||
@@ -75,15 +76,16 @@ struct t_voice
|
||||
void voice_process( void ) ;
|
||||
};
|
||||
|
||||
extern void pushCustomPrompt( uint8_t value );
|
||||
extern void pushPrompt( uint8_t value );
|
||||
extern void pushPrompt16(uint16_t value);
|
||||
extern void pushPrompt(uint16_t value);
|
||||
extern void pushCustomPrompt(uint8_t value);
|
||||
extern void pushNumberPrompt(uint8_t value);
|
||||
|
||||
extern struct t_voice *voiceaddress( void ) ;
|
||||
extern struct t_voice Voice ;
|
||||
|
||||
#define VOLUME_LEVEL_MAX 7
|
||||
#define VOLUME_LEVEL_DEF 7
|
||||
#define setVolume(v) pushPrompt16((v) | 0xFFF0)
|
||||
#define setVolume(v) pushPrompt((v) | 0xFFF0)
|
||||
|
||||
inline bool isPlaying()
|
||||
{
|
||||
@@ -99,24 +101,18 @@ inline bool isPlaying()
|
||||
* Check for LcdLocked (in interrupt), and voice_enabled
|
||||
*/
|
||||
#define VOICE_DRIVER() \
|
||||
if ( LcdLock == 0 ) /* LCD not in use */ \
|
||||
{ \
|
||||
if ( LcdLock == 0 ) { /* LCD not in use */ \
|
||||
struct t_voice *vptr; \
|
||||
vptr = voiceaddress(); \
|
||||
if ( vptr->VoiceState == V_CLOCKING ) \
|
||||
{ \
|
||||
if ( vptr->VoiceTimer ) \
|
||||
{ \
|
||||
if ( vptr->VoiceState == V_CLOCKING ) { \
|
||||
if ( vptr->VoiceTimer ) { \
|
||||
vptr->VoiceTimer -= 1; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
else { \
|
||||
PORTB |= (1<<OUT_B_LIGHT); /* Latch clock high */ \
|
||||
if ((vptr->VoiceCounter & 1) == 0) \
|
||||
{ \
|
||||
if ((vptr->VoiceCounter & 1) == 0) { \
|
||||
vptr->VoiceLatch &= ~VOICE_DATA_BIT; \
|
||||
if ( vptr->VoiceSerial & 0x4000 ) \
|
||||
{ \
|
||||
if ( vptr->VoiceSerial & 0x4000 ) { \
|
||||
vptr->VoiceLatch |= VOICE_DATA_BIT; \
|
||||
} \
|
||||
vptr->VoiceSerial <<= 1; \
|
||||
@@ -124,8 +120,7 @@ inline bool isPlaying()
|
||||
vptr->VoiceLatch ^= VOICE_CLOCK_BIT; \
|
||||
PORTA_LCD_DAT = vptr->VoiceLatch; /* Latch data set */ \
|
||||
PORTB &= ~(1<<OUT_B_LIGHT); /* Latch clock low */ \
|
||||
if ( --vptr->VoiceCounter == 0 ) \
|
||||
{ \
|
||||
if ( --vptr->VoiceCounter == 0 ) { \
|
||||
vptr->VoiceState = V_WAIT_BUSY_ON; \
|
||||
vptr->VoiceTimer = 5; /* 50 mS */ \
|
||||
} \
|
||||
@@ -134,8 +129,9 @@ inline bool isPlaying()
|
||||
}
|
||||
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__)
|
||||
#define PUSH_PROMPT(p) pushPrompt((p))
|
||||
#define PUSH_CUSTOM_PROMPT(p, ...) pushCustomPrompt((p))
|
||||
#define PUSH_NUMBER_PROMPT(p) pushNumberPrompt((p))
|
||||
#define PUSH_SYSTEM_PROMPT(p) pushNumberPrompt(PROMPT_SYSTEM_BASE-PROMPT_I18N_BASE+(p))
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a))
|
||||
#define PLAY_DURATION(d) playDuration((d))
|
||||
#define IS_PLAYING(id) (0) /* isPlaying() */
|
||||
|
||||
+14
-14
@@ -101,18 +101,18 @@ enum CzechPrompts {
|
||||
PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
if (number == 1)
|
||||
PUSH_PROMPT(unitprompt);
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_PROMPT(unitprompt+1);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_PROMPT(unitprompt+2);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
@@ -123,11 +123,11 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_PROMPT(PROMPT_CELA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CELA);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(qr.quot, PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -158,17 +158,17 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_PROMPT(PROMPT_JEDEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_PROMPT(PROMPT_JEDNO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_PROMPT(PROMPT_DVE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
@@ -176,22 +176,22 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 2000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 5000)
|
||||
PUSH_PROMPT(PROMPT_TISICE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TISICE);
|
||||
else
|
||||
PUSH_PROMPT(PROMPT_TISIC);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TISIC);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_NULA+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
@@ -202,7 +202,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -102,7 +102,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
int8_t mode = MODE(att);
|
||||
@@ -110,9 +110,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_COMMA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_COMMA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_NULL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULL);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -124,9 +124,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 1100) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_TAUSEND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TAUSEND);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_TAUSEND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TAUSEND);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
@@ -134,23 +134,23 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_PROMPT(PROMPT_NULL + number/100);
|
||||
PUSH_PROMPT(PROMPT_HUNDERT);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULL + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HUNDERT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_NULL+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULL+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
seconds %= 3600;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_UHR);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UHR);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
@@ -167,17 +167,17 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
if (tmp != 1) {
|
||||
PUSH_PROMPT(PROMPT_MINUTEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTEN);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MINUTE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTE);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_UND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UND);
|
||||
}
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
if (seconds != 1) {
|
||||
PUSH_PROMPT(PROMPT_SECUNDEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECUNDEN);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_SECUNDE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECUNDE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,15 +81,15 @@ enum EnglishPrompts {
|
||||
PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
if (number == 1)
|
||||
PUSH_PROMPT(unitprompt);
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_PROMPT(unitprompt+1);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_POINT_BASE + qr.rem);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
@@ -111,19 +111,19 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_THOUSAND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_HUNDRED + (number/100)-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_ZERO + number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
@@ -134,7 +134,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES+1 , 0);
|
||||
if (seconds > 0)
|
||||
PUSH_PROMPT(PROMPT_AND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
|
||||
+19
-19
@@ -126,7 +126,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
int8_t mode = MODE(att);
|
||||
@@ -134,9 +134,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGOLA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_ZERO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -148,31 +148,31 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_CIENTO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CIENTO + number/100);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -183,10 +183,10 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
ore=tmp;
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_HORAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORAS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UNA);
|
||||
PUSH_PROMPT(PROMPT_HORA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,20 +195,20 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MINUTOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_MINUTO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTO);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_Y);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_Y);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -108,7 +108,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MOINS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MOINS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGULE_BASE + qr.rem);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGULE_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
@@ -129,35 +129,35 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MILLE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MILLE);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_PROMPT(PROMPT_CENT);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CENT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (((number % 10) == 1) && number < 90 && (att & FEMININ)) {
|
||||
PUSH_PROMPT(PROMPT_UNE+(number/10));
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNE+(number/10));
|
||||
}
|
||||
else if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MOINS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MOINS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -165,21 +165,21 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
seconds %= 3600;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, 0, FEMININ);
|
||||
PUSH_PROMPT(PROMPT_HEURE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HEURE);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, 0, FEMININ);
|
||||
PUSH_PROMPT(PROMPT_MINUTE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTE);
|
||||
if (seconds > 0)
|
||||
PUSH_PROMPT(PROMPT_ET);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ET);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, 0, FEMININ);
|
||||
PUSH_PROMPT(PROMPT_SECONDE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECONDE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+20
-20
@@ -98,7 +98,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
int8_t mode = MODE(att);
|
||||
@@ -106,9 +106,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGOLA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_ZERO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -120,9 +120,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MILA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MILA);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MILLE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MILLE);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
@@ -130,23 +130,23 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_PROMPT(PROMPT_CENT);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CENT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -157,10 +157,10 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
ore=tmp;
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_ORE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ORE);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_ORA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ORA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,20 +169,20 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MINUTI);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTI);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_MINUTO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTO);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_E);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_E);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_SECONDI);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECONDI);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_SECONDO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECONDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -111,7 +111,7 @@ enum PortuguesePrompts {
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENOS);
|
||||
number = -number;
|
||||
}
|
||||
int8_t mode = MODE(att);
|
||||
@@ -119,9 +119,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGULA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGULA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_ZERO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -133,31 +133,31 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_CENTO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CENTO + number/100);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENOS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -168,13 +168,13 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
ore=tmp;
|
||||
if (tmp > 2) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_HORAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORAS);
|
||||
} else if (tmp==2) {
|
||||
PUSH_PROMPT(PROMPT_DUAS);
|
||||
PUSH_PROMPT(PROMPT_HORAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DUAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORAS);
|
||||
} else if (tmp==1) {
|
||||
PUSH_PROMPT(PROMPT_UMA);
|
||||
PUSH_PROMPT(PROMPT_HORA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UMA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,20 +183,20 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MINUTOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_PROMPT(PROMPT_MINUTO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTO);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_E);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_E);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -116,18 +116,18 @@ enum SlovakPrompts {
|
||||
PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
if (number == 1)
|
||||
PUSH_PROMPT(unitprompt);
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_PROMPT(unitprompt+1);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_PROMPT(unitprompt+2);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
@@ -138,11 +138,11 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_PROMPT(PROMPT_CELA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CELA);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(qr.quot, PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -173,17 +173,17 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_PROMPT(PROMPT_JEDEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_PROMPT(PROMPT_JEDNO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_PROMPT(PROMPT_DVE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
@@ -191,23 +191,23 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 3000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 3000)
|
||||
PUSH_PROMPT(PROMPT_DVETISIC);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DVETISIC);
|
||||
else
|
||||
PUSH_PROMPT(PROMPT_TISIC);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TISIC);
|
||||
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_NULA+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
@@ -218,7 +218,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user