SOMO-14D work for the gruvin9x board
This commit is contained in:
+1
-1
@@ -191,7 +191,7 @@ FORMAT = ihex
|
||||
TARGET = open9x
|
||||
|
||||
# List C++ source files here. (C dependencies are automatically generated.)
|
||||
CPPSRC = open9x.cpp $(PULSESSRC) stamp.cpp menus.cpp model_menus.cpp general_menus.cpp main_views.cpp statistics_views.cpp $(EEPROMSRC) lcd.cpp drivers.cpp o9xstrings.cpp
|
||||
CPPSRC = open9x.cpp $(PULSESSRC) stamp.cpp menus.cpp model_menus.cpp general_menus.cpp main_views.cpp statistics_views.cpp $(EEPROMSRC) lcd.cpp drivers.cpp translations.cpp
|
||||
|
||||
ifeq ($(EXT), JETI)
|
||||
CPPSRC += jeti.cpp
|
||||
|
||||
@@ -913,7 +913,6 @@ uint32_t unprotect_eeprom()
|
||||
|
||||
#if defined(SDCARD)
|
||||
FATFS g_FATFS_Obj; // TODO not here
|
||||
#define FILENAME_MAXLEN 8
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char *buf = reusableBuffer.models.mainname;
|
||||
|
||||
@@ -531,7 +531,6 @@ bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc)
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define FILENAME_MAXLEN 8
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char *buf = reusableBuffer.models.mainname;
|
||||
|
||||
+1
-1
@@ -915,7 +915,7 @@ int16_t convertTelemValue(uint8_t channel, uint8_t value)
|
||||
return result;
|
||||
}
|
||||
|
||||
static const pm_uint8_t bchunit_ar[] PROGMEM = {
|
||||
const pm_uint8_t bchunit_ar[] PROGMEM = {
|
||||
UNIT_METERS, // Alt
|
||||
UNIT_RAW, // Rpm
|
||||
UNIT_PERCENT, // Fuel
|
||||
|
||||
@@ -182,6 +182,8 @@ uint8_t maxTelemValue(uint8_t channel);
|
||||
int16_t convertTelemValue(uint8_t channel, uint8_t value);
|
||||
NOINLINE uint8_t getRssiAlarmValue(uint8_t alarm);
|
||||
|
||||
extern const pm_uint8_t bchunit_ar[];
|
||||
int16_t applyChannelRatio(uint8_t channel, int16_t val);
|
||||
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -150,9 +150,14 @@ ISR(TIMER4_COMPA_vect) //Every 0.5ms
|
||||
return BUSY;
|
||||
}
|
||||
|
||||
void somoPushPrompt(uint16_t prompt)
|
||||
void pushPrompt(uint16_t prompt)
|
||||
{
|
||||
somo14playlist[somo14WIdx] = prompt;
|
||||
somo14WIdx = (somo14WIdx + 1) % QUEUE_LENGTH;
|
||||
TIMSK4 |= (1<<OCIE4A);
|
||||
}
|
||||
|
||||
bool isPlaying()
|
||||
{
|
||||
return TIMSK4 & (1<<OCIE4A);
|
||||
}
|
||||
|
||||
@@ -31,4 +31,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
extern void somoPushPrompt(uint16_t prompt);
|
||||
#define PROMPT_CUSTOM_BASE 100
|
||||
|
||||
extern void pushPrompt(uint16_t prompt);
|
||||
extern bool isPlaying();
|
||||
|
||||
|
||||
+5
-1
@@ -2210,9 +2210,13 @@ void menuProcFunctionSwitches(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
#if defined(SOMO)
|
||||
else if (sd->func == FUNC_PLAY_SOMO) {
|
||||
else if (sd->func == FUNC_PLAY_TRACK) {
|
||||
lcd_outdezAtt(21*FW, y, val_displayed, attr);
|
||||
}
|
||||
else if (sd->func == FUNC_PLAY_VALUE) {
|
||||
val_max = NUM_XCHNPLAY;
|
||||
putsChnRaw(17*FW, y, val_displayed, attr);
|
||||
}
|
||||
#endif
|
||||
else if (sd->func == FUNC_RESET) {
|
||||
val_max = 3;
|
||||
|
||||
+4
-3
@@ -292,11 +292,12 @@ enum Functions {
|
||||
FUNC_INSTANT_TRIM,
|
||||
FUNC_PLAY_SOUND,
|
||||
FUNC_HAPTIC,
|
||||
#if defined(PCBV4)
|
||||
FUNC_PLAY_SOMO,
|
||||
#endif
|
||||
FUNC_RESET,
|
||||
FUNC_VARIO,
|
||||
#if defined(SOMO)
|
||||
FUNC_PLAY_TRACK,
|
||||
FUNC_PLAY_VALUE,
|
||||
#endif
|
||||
#if defined(PCBV4)
|
||||
FUNC_LOGS,
|
||||
#endif
|
||||
|
||||
+91
-2
@@ -1457,6 +1457,85 @@ void testFunc()
|
||||
uint16_t active_functions = 0;
|
||||
MASK_FSW_TYPE active_switches = 0;
|
||||
|
||||
#if defined(SOMO)
|
||||
void playValue(uint8_t idx)
|
||||
{
|
||||
int16_t val = getValue(idx);
|
||||
switch (idx) {
|
||||
case NUM_XCHNRAW+TELEM_TM1-1:
|
||||
case NUM_XCHNRAW+TELEM_TM2-1:
|
||||
playDuration(val);
|
||||
break;
|
||||
case NUM_XCHNRAW+TELEM_MIN_A1-1:
|
||||
case NUM_XCHNRAW+TELEM_MIN_A2-1:
|
||||
idx -= TELEM_MIN_A1-1-MAX_TIMERS;
|
||||
// no break
|
||||
case NUM_XCHNRAW+TELEM_A1-1:
|
||||
case NUM_XCHNRAW+TELEM_A2-1:
|
||||
idx -= NUM_XCHNRAW+MAX_TIMERS;
|
||||
// A1 and A2
|
||||
{
|
||||
uint8_t att = 0;
|
||||
int16_t converted_value = applyChannelRatio(idx, val);
|
||||
if (g_model.frsky.channels[idx].type >= UNIT_RAW) {
|
||||
converted_value /= 10;
|
||||
}
|
||||
else {
|
||||
if (converted_value < 1000) {
|
||||
att |= PREC2;
|
||||
}
|
||||
else {
|
||||
converted_value /= 10;
|
||||
att |= PREC1;
|
||||
}
|
||||
}
|
||||
playNumber(converted_value, UNIT_VOLTS, att);
|
||||
break;
|
||||
}
|
||||
|
||||
case NUM_XCHNRAW+TELEM_CELL-1:
|
||||
playNumber(val, UNIT_VOLTS, PREC2);
|
||||
break;
|
||||
|
||||
case NUM_XCHNRAW+TELEM_ACCx-1:
|
||||
case NUM_XCHNRAW+TELEM_ACCy-1:
|
||||
case NUM_XCHNRAW+TELEM_ACCz-1:
|
||||
case NUM_XCHNRAW+TELEM_VSPD-1:
|
||||
playNumber(val, UNIT_RAW, PREC2);
|
||||
break;
|
||||
|
||||
case NUM_XCHNRAW+TELEM_RSSI_TX-1:
|
||||
case NUM_XCHNRAW+TELEM_RSSI_RX-1:
|
||||
playNumber(val);
|
||||
break;
|
||||
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
case NUM_XCHNRAW+TELEM_ALT-1:
|
||||
case NUM_XCHNRAW+TELEM_MIN_ALT-1:
|
||||
case NUM_XCHNRAW+TELEM_MAX_ALT-1:
|
||||
if (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH) {
|
||||
playNumber(val, UNIT_FEET);
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
#endif
|
||||
|
||||
default:
|
||||
{
|
||||
uint8_t unit;
|
||||
if (idx <= NUM_XCHNRAW+TELEM_GPSALT-1)
|
||||
unit = idx - NUM_XCHNRAW - 6;
|
||||
else if (idx >= NUM_XCHNRAW+TELEM_MAX_T1-1 && idx <= NUM_XCHNRAW+TELEM_MAX_DIST-1)
|
||||
unit = idx - NUM_XCHNRAW - 22;
|
||||
else
|
||||
unit = 1;
|
||||
playNumber(val, pgm_read_byte(bchunit_ar+unit));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void evalFunctions()
|
||||
{
|
||||
assert((int)(sizeof(active_functions)*8) > (int)(FUNC_MAX-NUM_CHNOUT));
|
||||
@@ -1531,8 +1610,18 @@ void evalFunctions()
|
||||
#endif
|
||||
|
||||
#if defined(SOMO)
|
||||
if (sd->func == FUNC_PLAY_SOMO) {
|
||||
somoPushPrompt(sd->param);
|
||||
if (sd->func == FUNC_PLAY_TRACK || sd->func == FUNC_PLAY_VALUE) {
|
||||
if (!isPlaying()) {
|
||||
static uint16_t s_last_play = 0;
|
||||
uint16_t tmr10ms = get_tmr10ms();
|
||||
if (tmr10ms - s_last_play >= 100) {
|
||||
s_last_play = tmr10ms;
|
||||
if (sd->func == FUNC_PLAY_TRACK)
|
||||
pushPrompt(PROMPT_CUSTOM_BASE+sd->param);
|
||||
else
|
||||
playValue(sd->param);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+6
-4
@@ -416,9 +416,10 @@ extern Key keys[NUM_KEYS];
|
||||
#define NUM_TELEMETRY TELEM_TM2
|
||||
#endif
|
||||
|
||||
#define NUM_XCHNRAW (NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1/*MAX*/+1/*ID3*/+NUM_CYC+NUM_PPM+NUM_CHNOUT)
|
||||
#define NUM_XCHNCSW (NUM_XCHNRAW+NUM_TELEMETRY)
|
||||
#define NUM_XCHNMIX (NUM_XCHNRAW+MAX_SWITCH)
|
||||
#define NUM_XCHNRAW (NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1/*MAX*/+1/*ID3*/+NUM_CYC+NUM_PPM+NUM_CHNOUT)
|
||||
#define NUM_XCHNCSW (NUM_XCHNRAW+NUM_TELEMETRY)
|
||||
#define NUM_XCHNMIX (NUM_XCHNRAW+MAX_SWITCH)
|
||||
#define NUM_XCHNPLAY (NUM_XCHNRAW+TELEM_DISPLAY_MAX)
|
||||
|
||||
#define DSW_THR 1
|
||||
#define DSW_RUD 2
|
||||
@@ -746,7 +747,7 @@ extern volatile uint8_t g_blinkTmr10ms;
|
||||
extern uint8_t g_beepCnt;
|
||||
extern uint8_t g_beepVal[5];
|
||||
|
||||
#include "o9xstrings.h"
|
||||
#include "translations.h"
|
||||
|
||||
extern uint8_t ppmInState; //0=unsync 1..8= wait for value i-1
|
||||
extern int16_t g_ppmIns[8];
|
||||
@@ -881,6 +882,7 @@ enum AUDIO_SOUNDS {
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define FILENAME_MAXLEN 8
|
||||
#include "gruvin9x/sdcard.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -354,3 +354,9 @@ const pm_uchar font_dblsize[] PROGMEM = {
|
||||
#include "font_dblsize_fr.lbm"
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(TRANSLATIONS_FR)
|
||||
#include "fr.cpp"
|
||||
#else
|
||||
#include "en.cpp"
|
||||
#endif
|
||||
@@ -31,8 +31,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef o9xstrings_h
|
||||
#define o9xstrings_h
|
||||
#ifndef translations_h
|
||||
#define translations_h
|
||||
|
||||
#if defined(TRANSLATIONS_FR)
|
||||
#include "translations/fr.h"
|
||||
@@ -405,4 +405,9 @@ extern const pm_char STR_THROTTLEWARN[];
|
||||
extern const pm_char STR_ALARMSWARN[];
|
||||
extern const pm_char STR_SWITCHWARN[];
|
||||
|
||||
#if defined(SOMO)
|
||||
void playNumber(int16_t number, uint8_t unit=0, uint8_t att=0);
|
||||
void playDuration(int16_t seconds);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+20
-17
@@ -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?"
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
@@ -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."
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user