SOMO-14D work for the gruvin9x board

This commit is contained in:
bsongis
2012-06-06 10:06:36 +00:00
parent 214332fbb9
commit 82fe7c61b1
21 changed files with 470 additions and 57 deletions
+20 -17
View File
@@ -12,7 +12,7 @@
#define TR_VBEEPMODE "Tich\212""Alarm""BezKL""V\207e "
#define LEN_VBEEPLEN "\005"
#define TR_VBEEPLEN "O====""=O===""==O==""===O=""====O"
#define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0"
#define LEN_VRENAVIG "\003"
#define TR_VRENAVIG "Ne REaREb"
@@ -113,20 +113,23 @@
#define TR_SDCLOGS "[SDCARD Logs]"
#endif
#if defined(SOMO)
#define TR_SOMO "P\206ehr\200t stopu"
#define TR_PLAY_TRACK "P\206ehr\200t stopu"
#define TR_PLAY_VALUE "Play Value\0 "
#else
#define TR_SOMO "[Hr\200t stopu]\0"
#define TR_PLAY_TRACK "[Hr\200t stopu]\0"
#define TR_PLAY_VALUE "[Play Value]\0"
#endif
#else
#define TR_SDCLOGS
#define TR_SOMO
#define TR_PLAY_TRACK
#define TR_PLAY_VALUE
#endif
#ifdef DEBUG
#define TR_TEST "Test\0 "
#else
#define TR_TEST
#endif
#define TR_VFSWFUNC "Bezpe\201\0 ""Tren\202r\0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
#define TR_VFSWFUNC "Bezpe\201\0 ""Tren\202r\0 ""Instant Trim " TR_SOUND TR_HAPTIC "Reset\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_TEST
#define LEN_VFSWRESET "\006"
#define TR_VFSWRESET "Timer1""Timer2""Vse ""Telem."
@@ -338,7 +341,7 @@
#define TR_CH "CH"
#define TR_MODEL "MODEL"
#define TR_FP "FP"
#define TR_EEPROMLOWMEM "Doch\200z\204 EEPROM"
#define TR_EEPROMLOWMEM "EEPROM low mem"
#define TR_ALERT "\003(!)POZOR"
#define TR_PRESSANYKEYTOSKIP "Kl\200vesa >>> p\206esko\201it"
#define TR_THROTTLENOTIDLE "P\200ka plynu je pohnut\200."
@@ -381,20 +384,20 @@
#define TR_LONGITUDE "Longitude"
#define TR_GPSCOORD "Gps Sou\206adnice"
#define TR_VARIO "Vario"
#define TR_SHUTDOWN "Vyp\204n\200n\204.."
#define TR_SHUTDOWN "SHUTTING DOWN"
#define TR_BATT_CALIB "Kalibrace Bat"
#define TR_CURRENT_CALIB "Kalib. Proudu"
#define TR_CURRENT "Proud"
#define TR_SELECT_MODEL "Vyber Model"
#define TR_CREATE_MODEL "Vytvo\206 Model"
#define TR_BACKUP_MODEL "Z\200lohuj Model"
#define TR_DELETE_MODEL "Sma\217 Model" // TODO merged into DELETEMODEL?
#define TR_RESTORE_MODEL "Obnov Model"
#define TR_SDCARD_ERROR "Chyba SDkarty"
#define TR_NO_SDCARD "Nen\204 SDkarta"
#define TR_CURRENT_CALIB "Current Calib"
#define TR_CURRENT "Current"
#define TR_SELECT_MODEL "Select Model"
#define TR_CREATE_MODEL "Create Model"
#define TR_BACKUP_MODEL "Backup Model"
#define TR_DELETE_MODEL "Delete Model" // TODO merged into DELETEMODEL?
#define TR_RESTORE_MODEL "Restore Model"
#define TR_SDCARD_ERROR "SDCARD Error"
#define TR_NO_SDCARD "No SDCARD"
#define TR_WARNING "KONTROLA"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "PLYNU"
#define TR_ALARMSWARN "ALARMU"
#define TR_SWITCHWARN "POZICE"
#define TR_INVERT_THR "Invertovat Plyn?"
#define TR_INVERT_THR "Invert Thr?"
+9 -6
View File
@@ -11,8 +11,8 @@
#define LEN_VBEEPMODE "\005"
#define TR_VBEEPMODE "Stumm""Alarm""NoKey""Alle "
#define LEN_VBEEPLEN "\005"
#define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0"
#define LEN_VBEEPLEN "\005"
#define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0"
#define LEN_VRENAVIG "\003"
#define TR_VRENAVIG "No REaREb"
@@ -108,20 +108,23 @@
#define TR_SDCLOGS "[SDCARD Logs]"
#endif
#if defined(SOMO)
#define TR_SOMO "Play Track\0 "
#define TR_PLAY_TRACK "Play Track\0 "
#define TR_PLAY_VALUE "Play Value\0 "
#else
#define TR_SOMO "[Play Track]\0"
#define TR_PLAY_TRACK "[Play Track]\0"
#define TR_PLAY_VALUE "[Play Value]\0"
#endif
#else
#define TR_SDCLOGS
#define TR_SOMO
#define TR_PLAY_TRACK
#define TR_PLAY_VALUE
#endif
#ifdef DEBUG
#define TR_TEST "Test\0 "
#else
#define TR_TEST
#endif
#define TR_VFSWFUNC "Safety\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
#define TR_VFSWFUNC "Safety\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC "Reset\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_TEST
#define LEN_VFSWRESET "\006"
#define TR_VFSWRESET "Timer1""Timer2""Alle ""Telem."
+138
View File
@@ -0,0 +1,138 @@
/*
* Authors (alphabetical order)
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Jean-Pierre Parisy
* - Karl Szmutny <shadow@privy.de>
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
*
* open9x is based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
* and the original (and ongoing) project by
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "../open9x.h"
enum EnglishPrompts {
PROMPT_NUMBERS_BASE = 0,
PROMPT_ZERO = PROMPT_NUMBERS_BASE+0,
/* ... */
PROMPT_TWENTY = PROMPT_NUMBERS_BASE+20,
PROMPT_THIRTY = PROMPT_NUMBERS_BASE+21,
/* ... */
PROMPT_NINETY = PROMPT_NUMBERS_BASE+27,
PROMPT_HUNDRED = PROMPT_NUMBERS_BASE+28,
PROMPT_THOUSAND = PROMPT_NUMBERS_BASE+29,
PROMPT_HOUR = 40,
PROMPT_HOURS = 41,
PROMPT_MINUTE = 42,
PROMPT_MINUTES = 43,
PROMPT_SECOND = 44,
PROMPT_SECONDS = 45,
PROMPT_AND = 47,
PROMPT_MINUS = 48,
PROMPT_UNITS_BASE = 50,
PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS,
PROMPT_AMPS = PROMPT_UNITS_BASE+UNIT_AMPS,
PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
PROMPT_SPARE1 = PROMPT_UNITS_BASE+UNIT_RAW,
PROMPT_KMH = PROMPT_UNITS_BASE+UNIT_KMH,
PROMPT_METERS = PROMPT_UNITS_BASE+UNIT_METERS,
PROMPT_DEGREES = PROMPT_UNITS_BASE+UNIT_DEGREES,
PROMPT_PERCENT = PROMPT_UNITS_BASE+UNIT_PERCENT,
PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
};
#if defined(SOMO)
void playNumber(int16_t number, uint8_t unit, uint8_t att)
{
/* if digit >= 1000000000:
temp_digit, digit = divmod(digit, 1000000000)
prompts.extend(self.getNumberPrompt(temp_digit))
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
if digit >= 1000000:
temp_digit, digit = divmod(digit, 1000000)
prompts.extend(self.getNumberPrompt(temp_digit))
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
*/
if (number >= 1000) {
playNumber(number / 1000);
pushPrompt(PROMPT_THOUSAND);
number %= 1000;
if (number == 0)
return;
}
if (number >= 100) {
pushPrompt(PROMPT_ZERO + number/100);
pushPrompt(PROMPT_HUNDRED);
number %= 100;
if (number == 0)
return;
}
if (number >= 20) {
pushPrompt(PROMPT_TWENTY + (number-20)/10);
number %= 10;
if (number == 0)
return;
}
pushPrompt(PROMPT_ZERO+number);
if (unit) {
pushPrompt(PROMPT_UNITS_BASE+unit-1);
}
}
void playDuration(int16_t seconds)
{
if (seconds < 0) {
pushPrompt(PROMPT_MINUS);
seconds = -seconds;
}
uint8_t tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0) {
playNumber(tmp);
pushPrompt(tmp == 1 ? PROMPT_HOUR : PROMPT_HOURS);
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
playNumber(tmp);
pushPrompt(tmp == 1 ? PROMPT_MINUTE : PROMPT_MINUTES);
if (seconds > 0)
pushPrompt(PROMPT_AND);
}
if (seconds > 0) {
playNumber(seconds);
pushPrompt(tmp == 1 ? PROMPT_SECOND : PROMPT_SECONDS);
}
}
#endif
+8 -4
View File
@@ -113,20 +113,24 @@
#define TR_SDCLOGS "[SDCARD Logs]"
#endif
#if defined(SOMO)
#define TR_SOMO "Play Track\0 "
#define TR_PLAY_TRACK "Play Track\0 "
#define TR_PLAY_VALUE "Play Value\0 "
#else
#define TR_SOMO "[Play Track]\0"
#define TR_PLAY_TRACK "[Play Track]\0"
#define TR_PLAY_VALUE "[Play Value]\0"
#endif
#else
#define TR_SDCLOGS
#define TR_SOMO
#define TR_PLAY_TRACK
#define TR_PLAY_VALUE
#endif
#ifdef DEBUG
#define TR_TEST "Test\0"
#else
#define TR_TEST
#endif
#define TR_VFSWFUNC "Safety\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
#define TR_VFSWFUNC "Safety\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC "Reset\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_TEST
#define LEN_VFSWRESET "\006"
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
+140
View File
@@ -0,0 +1,140 @@
/*
* Authors (alphabetical order)
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Jean-Pierre Parisy
* - Karl Szmutny <shadow@privy.de>
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
*
* open9x is based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
* and the original (and ongoing) project by
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "../open9x.h"
enum FrenchPrompts {
PROMPT_NUMBERS_BASE = 0,
PROMPT_ZERO = PROMPT_NUMBERS_BASE+0,
/* ... */
PROMPT_VINGT = PROMPT_NUMBERS_BASE+20,
PROMPT_TRENTE = PROMPT_NUMBERS_BASE+21,
/* ... */
PROMPT_QUATREVINGTDIX = PROMPT_NUMBERS_BASE+27,
PROMPT_CENT = PROMPT_NUMBERS_BASE+28,
PROMPT_MILLE = PROMPT_NUMBERS_BASE+29,
PROMPT_HOUR = 40,
PROMPT_HOURS = 41,
PROMPT_MINUTE = 42,
PROMPT_MINUTES = 43,
PROMPT_SECOND = 44,
PROMPT_SECONDS = 45,
PROMPT_AND = 47,
PROMPT_MINUS = 48,
PROMPT_UNITS_BASE = 50,
PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS,
PROMPT_AMPS = PROMPT_UNITS_BASE+UNIT_AMPS,
PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
PROMPT_SPARE1 = PROMPT_UNITS_BASE+UNIT_RAW,
PROMPT_KMH = PROMPT_UNITS_BASE+UNIT_KMH,
PROMPT_METERS = PROMPT_UNITS_BASE+UNIT_METERS,
PROMPT_DEGREES = PROMPT_UNITS_BASE+UNIT_DEGREES,
PROMPT_PERCENT = PROMPT_UNITS_BASE+UNIT_PERCENT,
PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
};
#if defined(SOMO)
void playNumber(int16_t number, uint8_t unit, uint8_t att)
{
/* if digit >= 1000000000:
temp_digit, digit = divmod(digit, 1000000000)
prompts.extend(self.getNumberPrompt(temp_digit))
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
if digit >= 1000000:
temp_digit, digit = divmod(digit, 1000000)
prompts.extend(self.getNumberPrompt(temp_digit))
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
*/
if (number >= 1000) {
if (number >= 2000)
playNumber(number / 1000);
pushPrompt(PROMPT_MILLE);
number %= 1000;
if (number == 0)
return;
}
if (number >= 100) {
if (number >= 200)
pushPrompt(PROMPT_ZERO + number/100);
pushPrompt(PROMPT_CENT);
number %= 100;
if (number == 0)
return;
}
if (number >= 20) {
pushPrompt(PROMPT_VINGT + (number-20)/10);
number %= 10;
if (number == 0)
return;
}
pushPrompt(PROMPT_ZERO+number);
if (unit) {
pushPrompt(PROMPT_UNITS_BASE+unit-1);
}
}
void playDuration(int16_t seconds)
{
if (seconds < 0) {
pushPrompt(PROMPT_MINUS);
seconds = -seconds;
}
uint8_t tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0) {
playNumber(tmp);
pushPrompt(tmp == 1 ? PROMPT_HOUR : PROMPT_HOURS);
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
playNumber(tmp);
pushPrompt(tmp == 1 ? PROMPT_MINUTE : PROMPT_MINUTES);
if (seconds > 0)
pushPrompt(PROMPT_AND);
}
if (seconds > 0) {
playNumber(seconds);
pushPrompt(tmp == 1 ? PROMPT_SECOND : PROMPT_SECONDS);
}
}
#endif
+7 -4
View File
@@ -108,20 +108,23 @@
#define TR_SDCLOGS "[Logs SD] "
#endif
#if defined(SOMO)
#define TR_SOMO "Jouer fichier"
#define TR_PLAY_TRACK "Jouer fichier"
#define TR_PLAY_VALUE "Jouer valeur "
#else
#define TR_SOMO "[Jouer fich.]"
#define TR_PLAY_TRACK "[Jouer fich.]"
#define TR_PLAY_VALUE "[Jouer val.] "
#endif
#else
#define TR_SDCLOGS
#define TR_SOMO
#define TR_PLAY_TRACK
#define TR_PLAY_VALUE
#endif
#ifdef DEBUG
#define TR_TEST "Test\0 "
#else
#define TR_TEST
#endif
#define TR_VFSWFUNC "S\200cur.\0 ""Ecolage \0 ""Trim instant." TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
#define TR_VFSWFUNC "S\200cur.\0 ""Ecolage \0 ""Trim instant." TR_SOUND TR_HAPTIC "Reset\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_TEST
#define LEN_VFSWRESET "\006"
#define TR_VFSWRESET "Timer1""Timer2""Tout ""T\200l\200m."
+7 -4
View File
@@ -113,20 +113,23 @@
#define TR_SDCLOGS "[SDCARD Logs]"
#endif
#if defined(SOMO)
#define TR_SOMO "Brano\0 "
#define TR_PLAY_TRACK "Brano\0 "
#define TR_PLAY_VALUE "Play Value\0 "
#else
#define TR_SOMO "[Brano]\0 "
#define TR_PLAY_TRACK "[Brano]\0 "
#define TR_PLAY_VALUE "[Play Value]\0"
#endif
#else
#define TR_SDCLOGS
#define TR_SOMO
#define TR_PLAY_TRACK
#define TR_PLAY_VALUE
#endif
#ifdef DEBUG
#define TR_TEST "Test\0 "
#else
#define TR_TEST
#endif
#define TR_VFSWFUNC "Blocco\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
#define TR_VFSWFUNC "Blocco\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC "Reset\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_TEST
#define LEN_VFSWRESET "\006"
#define TR_VFSWRESET "Timer1""Timer2""Tutto ""Telem."
+7 -4
View File
@@ -108,20 +108,23 @@
#define TR_SDCLOGS "[SDCARD Logg]"
#endif
#if defined(SOMO)
#define TR_SOMO "Spela Sp\200r\0 "
#define TR_PLAY_TRACK "Spela Sp\200r\0 "
#define TR_PLAY_VALUE "Play Value\0 "
#else
#define TR_SOMO "[Spela Sp\200r]\0"
#define TR_PLAY_TRACK "[Spela Sp\200r]\0"
#define TR_PLAY_VALUE "[Play Value]\0"
#endif
#else
#define TR_SDCLOGS
#define TR_SOMO
#define TR_PLAY_TRACK
#define TR_PLAY_VALUE
#endif
#ifdef DEBUG
#define TR_TEST "Test\0 "
#else
#define TR_TEST
#endif
#define TR_VFSWFUNC "S\201kra\0 ""Trainer\0 ""S\201tt Trim " TR_SOUND TR_HAPTIC TR_SOMO "Nollst\201ll " TR_VVARIO TR_SDCLOGS TR_TEST
#define TR_VFSWFUNC "S\201kra\0 ""Trainer\0 ""S\201tt Trim " TR_SOUND TR_HAPTIC "Nollst\201ll " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_TEST
#define LEN_VFSWRESET "\006"
#define TR_VFSWRESET "Timer1""Timer2""Allt ""Telem."