Some Haptic corrections
This commit is contained in:
+6
-4
@@ -526,8 +526,8 @@ bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SDCARD
|
#if defined(SDCARD)
|
||||||
const pm_char * eeArchiveModel(uint8_t i_fileSrc)
|
const pm_char * eeBackupModel(uint8_t i_fileSrc)
|
||||||
{
|
{
|
||||||
char *buf = reusableBuffer.model_name;
|
char *buf = reusableBuffer.model_name;
|
||||||
FIL archiveFile;
|
FIL archiveFile;
|
||||||
@@ -626,6 +626,10 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (EFile::exists(FILE_MODEL(i_fileDst))) {
|
||||||
|
eeDeleteModel(i_fileDst);
|
||||||
|
}
|
||||||
|
|
||||||
theFile.create(FILE_MODEL(i_fileDst), FILE_TYP_MODEL, true);
|
theFile.create(FILE_MODEL(i_fileDst), FILE_TYP_MODEL, true);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -652,8 +656,6 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
|||||||
eeFs.files[FILE_TMP].size = theFile.m_pos;
|
eeFs.files[FILE_TMP].size = theFile.m_pos;
|
||||||
EFile::swap(theFile.m_fileId, FILE_TMP); // s_sync_write is set to false in swap();
|
EFile::swap(theFile.m_fileId, FILE_TMP); // s_sync_write is set to false in swap();
|
||||||
|
|
||||||
assert(!theFile.m_write_step);
|
|
||||||
|
|
||||||
f_close(&restoreFile);
|
f_close(&restoreFile);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -215,7 +215,7 @@ uint16_t evalChkSum();
|
|||||||
#define eeSwapModels(id1, id2) EFile::swap(FILE_MODEL(id1), FILE_MODEL(id2))
|
#define eeSwapModels(id1, id2) EFile::swap(FILE_MODEL(id1), FILE_MODEL(id2))
|
||||||
|
|
||||||
#ifdef SDCARD
|
#ifdef SDCARD
|
||||||
const pm_char * eeArchiveModel(uint8_t i_fileSrc);
|
const pm_char * eeBackupModel(uint8_t i_fileSrc);
|
||||||
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -612,7 +612,7 @@ inline void FRSKY10mspoll(void)
|
|||||||
void check_frsky()
|
void check_frsky()
|
||||||
{
|
{
|
||||||
#if defined(PCBARM)
|
#if defined(PCBARM)
|
||||||
rxPdcUsart(processSerialData); // Send serial data here
|
rxPdcUsart(processSerialData); // Receive serial data here
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Attempt to transmit any waiting Fr-Sky alarm set packets every 50ms (subject to packet buffer availability)
|
// Attempt to transmit any waiting Fr-Sky alarm set packets every 50ms (subject to packet buffer availability)
|
||||||
@@ -644,10 +644,10 @@ void check_frsky()
|
|||||||
if (isFunctionActive(FUNC_VARIO)) {
|
if (isFunctionActive(FUNC_VARIO)) {
|
||||||
#if defined(AUDIO)
|
#if defined(AUDIO)
|
||||||
int16_t verticalSpeed = 0;
|
int16_t verticalSpeed = 0;
|
||||||
//TODO: get negative values in Up Speed to shift zero, i.e. get positive sound on small negative speeds
|
// TODO: get negative values in Up Speed to shift zero, i.e. get positive sound on small negative speeds
|
||||||
// positive values in g_model.varioSpeedUpMin must works same as now
|
// positive values in g_model.varioSpeedUpMin must works same as now
|
||||||
// negative must make an offset in sounds
|
// negative must make an offset in sounds
|
||||||
// also changes need in model_menus.cpp
|
// also changes need in model_menus.cpp
|
||||||
verticalSpeed = limit((int16_t)(-VARIO_SPEED_LIMIT*100), (int16_t)frskyHubData.varioSpeed, (int16_t)(+VARIO_SPEED_LIMIT*100));
|
verticalSpeed = limit((int16_t)(-VARIO_SPEED_LIMIT*100), (int16_t)frskyHubData.varioSpeed, (int16_t)(+VARIO_SPEED_LIMIT*100));
|
||||||
|
|
||||||
uint8_t SoundAltBeepNextFreq = 0;
|
uint8_t SoundAltBeepNextFreq = 0;
|
||||||
|
|||||||
+8
-14
@@ -107,20 +107,14 @@ void hapticQueue::play(uint8_t tLen, uint8_t tPause, uint8_t tFlags)
|
|||||||
void hapticQueue::event(uint8_t e)
|
void hapticQueue::event(uint8_t e)
|
||||||
{
|
{
|
||||||
if (g_eeGeneral.hapticMode>0 || (g_eeGeneral.hapticMode==0 && e>=AU_WARNING1) || (g_eeGeneral.hapticMode>=-1 && e<=AU_ERROR)) {
|
if (g_eeGeneral.hapticMode>0 || (g_eeGeneral.hapticMode==0 && e>=AU_WARNING1) || (g_eeGeneral.hapticMode>=-1 && e<=AU_ERROR)) {
|
||||||
switch (e) {
|
if (e <= AU_ERROR)
|
||||||
case 0: // very little buzz for keys / trims
|
play(15, 3, PLAY_NOW);
|
||||||
play(5, 0, PLAY_NOW);
|
else if (e <= AU_TRIM_MOVE)
|
||||||
break;
|
play(5, 0, PLAY_NOW);
|
||||||
case AU_TIMER_20: // two buzz
|
else if (e <= AU_TIMER_LT3)
|
||||||
play(10,2,1);
|
play(15, 3, PLAY_NOW);
|
||||||
break;
|
else if (e < AU_FRSKY_FIRST)
|
||||||
case AU_TIMER_30: // three buzz
|
play(15, 3, (e-AU_TIMER_10)|PLAY_NOW);
|
||||||
play(10,2,2);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
play(10,2,0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-7
@@ -296,26 +296,32 @@ void menuProcModelSelect(uint8_t event)
|
|||||||
#endif
|
#endif
|
||||||
s_copyMode = 0;
|
s_copyMode = 0;
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
if (g_eeGeneral.currModel != sub) {
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
|
if (g_eeGeneral.currModel != sub) {
|
||||||
if (eeModelExists(sub)) {
|
if (eeModelExists(sub)) {
|
||||||
s_menu[s_menu_count++] = STR_LOAD_MODEL;
|
s_menu[s_menu_count++] = STR_LOAD_MODEL;
|
||||||
s_menu[s_menu_count++] = STR_ARCHIVE_MODEL;
|
s_menu[s_menu_count++] = STR_BACKUP_MODEL;
|
||||||
s_menu[s_menu_count++] = STR_DELETE_MODEL;;
|
s_menu[s_menu_count++] = STR_DELETE_MODEL;;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
s_menu[s_menu_count++] = STR_CREATE_MODEL;
|
s_menu[s_menu_count++] = STR_CREATE_MODEL;
|
||||||
s_menu[s_menu_count++] = STR_RESTORE_MODEL;;
|
s_menu[s_menu_count++] = STR_RESTORE_MODEL;;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
s_menu[s_menu_count++] = STR_BACKUP_MODEL;
|
||||||
|
s_menu[s_menu_count++] = STR_RESTORE_MODEL;;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
if (g_eeGeneral.currModel != sub) {
|
||||||
displayPopup(STR_LOADINGMODEL);
|
displayPopup(STR_LOADINGMODEL);
|
||||||
eeCheck(true); // force writing of current model data before this is changed
|
eeCheck(true); // force writing of current model data before this is changed
|
||||||
g_eeGeneral.currModel = sub;
|
g_eeGeneral.currModel = sub;
|
||||||
STORE_GENERALVARS;
|
STORE_GENERALVARS;
|
||||||
eeLoadModel(sub);
|
eeLoadModel(sub);
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (eeModelExists(sub)) {
|
else if (eeModelExists(sub)) {
|
||||||
s_copyMode = (s_copyMode == COPY_MODE ? MOVE_MODE : COPY_MODE);
|
s_copyMode = (s_copyMode == COPY_MODE ? MOVE_MODE : COPY_MODE);
|
||||||
@@ -440,10 +446,8 @@ void menuProcModelSelect(uint8_t event)
|
|||||||
eeLoadModel(sub);
|
eeLoadModel(sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (result == STR_ARCHIVE_MODEL) {
|
else if (result == STR_BACKUP_MODEL) {
|
||||||
s_sdcard_error = eeArchiveModel(sub);
|
s_sdcard_error = eeBackupModel(sub);
|
||||||
if (!s_sdcard_error)
|
|
||||||
eeDeleteModel(sub); // delete the model, it's archived!
|
|
||||||
}
|
}
|
||||||
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
|
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
|
||||||
if (!listSDcardModels()) {
|
if (!listSDcardModels()) {
|
||||||
|
|||||||
+1
-1
@@ -314,7 +314,7 @@ const pm_char STR_CURRENT[] PROGMEM = TR_CURRENT;
|
|||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
const pm_char STR_LOAD_MODEL[] PROGMEM = TR_LOAD_MODEL;
|
const pm_char STR_LOAD_MODEL[] PROGMEM = TR_LOAD_MODEL;
|
||||||
const pm_char STR_CREATE_MODEL[] PROGMEM = TR_CREATE_MODEL;
|
const pm_char STR_CREATE_MODEL[] PROGMEM = TR_CREATE_MODEL;
|
||||||
const pm_char STR_ARCHIVE_MODEL[] PROGMEM = TR_ARCHIVE_MODEL;
|
const pm_char STR_BACKUP_MODEL[] PROGMEM = TR_BACKUP_MODEL;
|
||||||
const pm_char STR_DELETE_MODEL[] PROGMEM = TR_DELETE_MODEL;
|
const pm_char STR_DELETE_MODEL[] PROGMEM = TR_DELETE_MODEL;
|
||||||
const pm_char STR_RESTORE_MODEL[] PROGMEM = TR_RESTORE_MODEL;
|
const pm_char STR_RESTORE_MODEL[] PROGMEM = TR_RESTORE_MODEL;
|
||||||
const pm_char STR_SDCARD_ERROR[] PROGMEM = TR_SDCARD_ERROR;
|
const pm_char STR_SDCARD_ERROR[] PROGMEM = TR_SDCARD_ERROR;
|
||||||
|
|||||||
+1
-1
@@ -381,7 +381,7 @@ extern const pm_char STR_CURRENT[];
|
|||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
extern const pm_char STR_LOAD_MODEL[];
|
extern const pm_char STR_LOAD_MODEL[];
|
||||||
extern const pm_char STR_CREATE_MODEL[];
|
extern const pm_char STR_CREATE_MODEL[];
|
||||||
extern const pm_char STR_ARCHIVE_MODEL[];
|
extern const pm_char STR_BACKUP_MODEL[];
|
||||||
extern const pm_char STR_DELETE_MODEL[];
|
extern const pm_char STR_DELETE_MODEL[];
|
||||||
extern const pm_char STR_RESTORE_MODEL[];
|
extern const pm_char STR_RESTORE_MODEL[];
|
||||||
extern const pm_char STR_SDCARD_ERROR[];
|
extern const pm_char STR_SDCARD_ERROR[];
|
||||||
|
|||||||
+3
-5
@@ -845,10 +845,10 @@ enum AUDIO_SOUNDS {
|
|||||||
AU_MIX_WARNING_1,
|
AU_MIX_WARNING_1,
|
||||||
AU_MIX_WARNING_2,
|
AU_MIX_WARNING_2,
|
||||||
AU_MIX_WARNING_3,
|
AU_MIX_WARNING_3,
|
||||||
AU_TIMER_30,
|
|
||||||
AU_TIMER_20,
|
|
||||||
AU_TIMER_10,
|
|
||||||
AU_TIMER_LT3,
|
AU_TIMER_LT3,
|
||||||
|
AU_TIMER_10,
|
||||||
|
AU_TIMER_20,
|
||||||
|
AU_TIMER_30,
|
||||||
AU_FRSKY_FIRST,
|
AU_FRSKY_FIRST,
|
||||||
AU_FRSKY_WARN1 = AU_FRSKY_FIRST,
|
AU_FRSKY_WARN1 = AU_FRSKY_FIRST,
|
||||||
AU_FRSKY_WARN2,
|
AU_FRSKY_WARN2,
|
||||||
@@ -866,8 +866,6 @@ enum AUDIO_SOUNDS {
|
|||||||
AU_FRSKY_LAST,
|
AU_FRSKY_LAST,
|
||||||
};
|
};
|
||||||
#if defined(AUDIO)
|
#if defined(AUDIO)
|
||||||
//audio settungs are external to keep out clutter!
|
|
||||||
// TODO english learning for me... what does mean "keep out clutter"?
|
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#else
|
#else
|
||||||
#include "beeper.h"
|
#include "beeper.h"
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ void audioQueue::heartbeat()
|
|||||||
#endif
|
#endif
|
||||||
toneTimeLeft--; //time gets counted down
|
toneTimeLeft--; //time gets counted down
|
||||||
toneFreq += toneFreqIncr;
|
toneFreq += toneFreqIncr;
|
||||||
|
// TODO tone2TimeLeft = 0?
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (tonePause > 0) {
|
if (tonePause > 0) {
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|
||||||
#define LEN_FUNCSOUNDS "\006"
|
#define LEN_FUNCSOUNDS "\006"
|
||||||
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
|
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
||||||
|
|
||||||
#define LEN_VTELEMCHNS "\004"
|
#define LEN_VTELEMCHNS "\004"
|
||||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
||||||
@@ -372,7 +372,7 @@
|
|||||||
#define TR_CURRENT "Current"
|
#define TR_CURRENT "Current"
|
||||||
#define TR_LOAD_MODEL "Load Model"
|
#define TR_LOAD_MODEL "Load Model"
|
||||||
#define TR_CREATE_MODEL "Create Model"
|
#define TR_CREATE_MODEL "Create Model"
|
||||||
#define TR_ARCHIVE_MODEL "Archive Model"
|
#define TR_BACKUP_MODEL "Backup Model"
|
||||||
#define TR_DELETE_MODEL "Delete Model" // TODO merged into DELETEMODEL?
|
#define TR_DELETE_MODEL "Delete Model" // TODO merged into DELETEMODEL?
|
||||||
#define TR_RESTORE_MODEL "Restore Model"
|
#define TR_RESTORE_MODEL "Restore Model"
|
||||||
#define TR_SDCARD_ERROR "SDCARD Error"
|
#define TR_SDCARD_ERROR "SDCARD Error"
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|
||||||
#define LEN_FUNCSOUNDS "\006"
|
#define LEN_FUNCSOUNDS "\006"
|
||||||
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
|
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
||||||
|
|
||||||
#define LEN_VTELEMCHNS "\004"
|
#define LEN_VTELEMCHNS "\004"
|
||||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
#define TR_CURRENT "Courant"
|
#define TR_CURRENT "Courant"
|
||||||
#define TR_LOAD_MODEL "Charger Modele"
|
#define TR_LOAD_MODEL "Charger Modele"
|
||||||
#define TR_CREATE_MODEL "Creer Modele"
|
#define TR_CREATE_MODEL "Creer Modele"
|
||||||
#define TR_ARCHIVE_MODEL "Archiver Modele"
|
#define TR_BACKUP_MODEL "Archiver Modele"
|
||||||
#define TR_DELETE_MODEL "Supprimer Modele"
|
#define TR_DELETE_MODEL "Supprimer Modele"
|
||||||
#define TR_RESTORE_MODEL "Restorer Modele"
|
#define TR_RESTORE_MODEL "Restorer Modele"
|
||||||
#define TR_SDCARD_ERROR "SDCARD Error"
|
#define TR_SDCARD_ERROR "SDCARD Error"
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|
||||||
#define LEN_FUNCSOUNDS "\006"
|
#define LEN_FUNCSOUNDS "\006"
|
||||||
#define TR_FUNCSOUNDS "Varn1 ""Varn2 ""F\200r ""Ring ""SciFi ""Robot ""Pip ""Tada ""Syrsa ""Siren ""Alarm ""Ratata""Tick ""Vibr1 ""Vibr2 ""Vibr3 "
|
#define TR_FUNCSOUNDS "Varn1 ""Varn2 ""F\200r ""Ring ""SciFi ""Robot ""Pip ""Tada ""Syrsa ""Siren ""Alarm ""Ratata""Tick "
|
||||||
|
|
||||||
#define LEN_VTELEMCHNS "\004"
|
#define LEN_VTELEMCHNS "\004"
|
||||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Tank""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Tid\0"
|
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Tank""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Tid\0"
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
#define TR_CURRENT "Sp\201nning"
|
#define TR_CURRENT "Sp\201nning"
|
||||||
#define TR_LOAD_MODEL "Load Model"
|
#define TR_LOAD_MODEL "Load Model"
|
||||||
#define TR_CREATE_MODEL "Create Model"
|
#define TR_CREATE_MODEL "Create Model"
|
||||||
#define TR_ARCHIVE_MODEL "Archive Model"
|
#define TR_BACKUP_MODEL "Backup Model"
|
||||||
#define TR_DELETE_MODEL "Delete Model"
|
#define TR_DELETE_MODEL "Delete Model"
|
||||||
#define TR_RESTORE_MODEL "Restore Model"
|
#define TR_RESTORE_MODEL "Restore Model"
|
||||||
#define TR_SDCARD_ERROR "SDCARD Error"
|
#define TR_SDCARD_ERROR "SDCARD Error"
|
||||||
|
|||||||
Reference in New Issue
Block a user