XCURVES option removed. There will be only one EEPROM format. And some functionnality will be removed later (no custom curves) when XCURVES will be disabled. For now it's always enabled.
This commit is contained in:
+1
-1
@@ -456,7 +456,7 @@ bool ee32LoadGeneral()
|
||||
}
|
||||
#ifdef SIMU
|
||||
else {
|
||||
printf("EEPROM version %d instead of %d\n", g_eeGeneral.myVers, EEPROM_VER);
|
||||
printf("EEPROM version %d (%d) instead of %d (%d)\n", g_eeGeneral.myVers, g_eeGeneral.variants, EEPROM_VER, EEPROM_VARIANTS);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -84,8 +84,10 @@ void retrieveAvailableAudioFiles()
|
||||
FILINFO info;
|
||||
char filename[32] = SYSTEM_SOUNDS_PATH "/";
|
||||
|
||||
#if !defined WIN32 && defined __GNUC__
|
||||
assert(sizeof(audioFilenames)==AU_FRSKY_FIRST*sizeof(char *));
|
||||
assert(sizeof(sdAvailableAudioFiles)*8 > AU_FRSKY_FIRST);
|
||||
#endif
|
||||
|
||||
sdAvailableAudioFiles = 0;
|
||||
|
||||
|
||||
+15
@@ -915,11 +915,21 @@ void lcdSendCtl(uint8_t val)
|
||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_CS1);
|
||||
}
|
||||
|
||||
#if defined(PCBSTD) && defined(VOICE)
|
||||
volatile uint8_t LcdLock ;
|
||||
#define LCD_LOCK() LcdLock = 1
|
||||
#define LCD_UNLOCK() LcdLock = 0
|
||||
#else
|
||||
#define LCD_LOCK()
|
||||
#define LCD_UNLOCK()
|
||||
#endif
|
||||
|
||||
inline void lcd_init()
|
||||
{
|
||||
// /home/thus/txt/datasheets/lcd/KS0713.pdf
|
||||
// ~/txt/flieger/ST7565RV17.pdf from http://www.glyn.de/content.asp?wdid=132&sid=
|
||||
|
||||
LCD_LOCK();
|
||||
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RES); //LCD_RES
|
||||
delay_1us();
|
||||
delay_1us();// f520 call 0xf4ce delay_1us() ; 0x0xf4ce
|
||||
@@ -938,17 +948,21 @@ inline void lcd_init()
|
||||
lcdSendCtl(0x22); // 24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18
|
||||
lcdSendCtl(0xAF); //DON = 1: display ON
|
||||
g_eeGeneral.contrast = 0x22;
|
||||
LCD_UNLOCK();
|
||||
}
|
||||
|
||||
void lcdSetRefVolt(uint8_t val)
|
||||
{
|
||||
LCD_LOCK();
|
||||
lcdSendCtl(0x81);
|
||||
lcdSendCtl(val);
|
||||
LCD_UNLOCK();
|
||||
}
|
||||
|
||||
#ifndef SIMU
|
||||
void refreshDisplay()
|
||||
{
|
||||
LCD_LOCK();
|
||||
uint8_t *p=displayBuf;
|
||||
for(uint8_t y=0; y < 8; y++) {
|
||||
lcdSendCtl(0x04);
|
||||
@@ -968,6 +982,7 @@ void refreshDisplay()
|
||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
|
||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_CS1);
|
||||
}
|
||||
LCD_UNLOCK();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -92,6 +92,10 @@
|
||||
extern uint8_t displayBuf[DISPLAY_W*DISPLAY_H/8];
|
||||
extern uint8_t lcdLastPos;
|
||||
|
||||
#if defined(PCBSTD) && defined(VOICE)
|
||||
extern volatile uint8_t LcdLock ;
|
||||
#endif
|
||||
|
||||
#if defined(PCBARM)
|
||||
extern uint8_t lcdLock ;
|
||||
extern uint32_t lcdInputs ;
|
||||
|
||||
+6
-174
@@ -1092,7 +1092,6 @@ void DrawCurve(FnFuncP fn)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(XCURVES)
|
||||
bool moveCurve(uint8_t index, int8_t shift, int8_t custom=0)
|
||||
{
|
||||
if (g_model.curves[MAX_CURVES-1] + shift > NUM_POINTS-5*MAX_CURVES) {
|
||||
@@ -1240,108 +1239,6 @@ void menuProcCurveOne(uint8_t event)
|
||||
|
||||
DrawCurve(curveFn);
|
||||
}
|
||||
#else
|
||||
void menuProcCurveOne(uint8_t event)
|
||||
{
|
||||
uint8_t points;
|
||||
int8_t *crv;
|
||||
static int8_t dfltCrv;
|
||||
|
||||
TITLE(STR_MENUCURVE);
|
||||
lcd_outdezAtt(5*FW+1, 0, s_curveChan+1, INVERS|LEFT);
|
||||
DISPLAY_PROGRESS_BAR(20*FW+1);
|
||||
|
||||
if (s_curveChan >= MAX_CURVE5) {
|
||||
points = 9;
|
||||
}
|
||||
else {
|
||||
points = 5;
|
||||
}
|
||||
|
||||
crv = curveaddress(s_curveChan);
|
||||
|
||||
switch(event) {
|
||||
case EVT_ENTRY:
|
||||
dfltCrv = 0;
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
s_editMode = -1;
|
||||
#endif
|
||||
break;
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
case EVT_KEY_BREAK(BTN_REa):
|
||||
case EVT_KEY_BREAK(BTN_REb):
|
||||
if (!navigationRotaryEncoder(event))
|
||||
break;
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MENU):
|
||||
if (s_editMode<=0) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
s_editMode = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (++dfltCrv > 4)
|
||||
dfltCrv = -4;
|
||||
for (uint8_t i=0; i<points; i++)
|
||||
crv[i] = (i-(points/2)) * dfltCrv * 50 / (points-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
killEvents(event);
|
||||
if (s_editMode>0) {
|
||||
m_posHorz = 0;
|
||||
s_editMode = 0;
|
||||
}
|
||||
else {
|
||||
popMenu();
|
||||
}
|
||||
break;
|
||||
case EVT_KEY_REPT(KEY_LEFT):
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
if (m_posHorz>0) m_posHorz--;
|
||||
break;
|
||||
case EVT_KEY_REPT(KEY_RIGHT):
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
if (m_posHorz<((s_editMode>0) ? points-1 : 1)) m_posHorz++;
|
||||
break;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < points; i++) {
|
||||
uint8_t x, y;
|
||||
if (i>4) {
|
||||
x = 8*FW; y = (i-4) * FH;
|
||||
}
|
||||
else {
|
||||
x = 4*FW; y = (i+1) * FH;
|
||||
}
|
||||
uint8_t attr = (s_editMode>0 && m_posHorz==i) ? INVERS : 0;
|
||||
lcd_outdezAtt(x, y, crv[i], attr);
|
||||
}
|
||||
|
||||
lcd_putsLeft(7*FH, STR_MODE);
|
||||
lcd_putsiAtt(5*FW-2, 7*FH, STR_CURVMODES, (s_editMode<=0)*m_posHorz, s_editMode>0 ? 0 : INVERS);
|
||||
|
||||
if (s_editMode>0) {
|
||||
for (uint8_t i=0; i<points; i++) {
|
||||
uint8_t xx = X0-1-WCHART+i*WCHART/(points/2);
|
||||
uint8_t yy = (DISPLAY_H-1) - (100 + crv[i]) * (DISPLAY_H-1) / 200;
|
||||
|
||||
if (m_posHorz==i) {
|
||||
lcd_filled_rect(xx-1, yy-2, 5, 5); // do selection square
|
||||
if (p1valdiff || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_DOWN) || event==EVT_KEY_REPT(KEY_UP))
|
||||
CHECK_INCDEC_MODELVAR( event, crv[i], -100,100); // edit on up/down
|
||||
}
|
||||
else {
|
||||
lcd_filled_rect(xx, yy-1, 3, 3); // do markup square
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DrawCurve(curveFn);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t getExpoMixCount(uint8_t expo)
|
||||
{
|
||||
@@ -1587,17 +1484,13 @@ void menuProcExpoOne(uint8_t event)
|
||||
if (attr) CHECK_INFLIGHT_INCDEC_MODELVAR(event, ed->expo, -100, 100, 0, STR_DREXPO);
|
||||
break;
|
||||
case EXPO_FIELD_CURVE:
|
||||
#if defined(XCURVES)
|
||||
putsCurve(6*FW+5, y, ed->curve, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR(event, ed->curve, 0, MAX_CURVES+7-1);
|
||||
#else
|
||||
putsCurve(6*FW+5, y, ed->curve+(ed->curve >= CURVE_BASE+4 ? 4 : 0), attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR(event, ed->curve, 0, 15);
|
||||
#endif
|
||||
|
||||
if (attr && ed->curve>=CURVE_BASE && event==EVT_KEY_FIRST(KEY_MENU)) {
|
||||
s_curveChan = ed->curve - (ed->curve >= CURVE_BASE+4 ? CURVE_BASE-4 : CURVE_BASE);
|
||||
pushMenu(menuProcCurveOne);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR(event, ed->curve, 0, MAX_CURVES+7-1);
|
||||
if (ed->curve>=CURVE_BASE && event==EVT_KEY_FIRST(KEY_MENU)) {
|
||||
s_curveChan = ed->curve - (ed->curve >= CURVE_BASE+4 ? CURVE_BASE-4 : CURVE_BASE);
|
||||
pushMenu(menuProcCurveOne);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef FLIGHT_PHASES
|
||||
@@ -1991,11 +1884,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_)
|
||||
#endif
|
||||
putsSwitches(EXPO_LINE_SWITCH_POS, y, ed->swtch, 0); // normal switches
|
||||
if (ed->mode!=3) lcd_putc(17*FW, y, ed->mode == 2 ? 126 : 127);//'|' : (stkVal[i] ? '<' : '>'),0);*/
|
||||
#if defined(XCURVES)
|
||||
if (ed->curve) putsCurve(18*FW+2, y, ed->curve);
|
||||
#else
|
||||
if (ed->curve) putsCurve(18*FW+2, y, ed->curve+(ed->curve >= CURVE_BASE+4 ? 4 : 0));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2251,7 +2140,6 @@ void menuProcLimits(uint8_t _event)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(XCURVES)
|
||||
void menuProcCurvesAll(uint8_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUCURVES, menuTabModel, e_CurvesAll, 1+MAX_CURVES);
|
||||
@@ -2285,62 +2173,6 @@ void menuProcCurvesAll(uint8_t event)
|
||||
s_curveChan = sub;
|
||||
DrawCurve(curveFn);
|
||||
}
|
||||
#else
|
||||
void menuProcCurvesAll(uint8_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUCURVES, menuTabModel, e_CurvesAll, 1+MAX_CURVES);
|
||||
|
||||
int8_t sub = m_posVert - 1;
|
||||
|
||||
switch (event) {
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
case EVT_KEY_BREAK(BTN_REa):
|
||||
case EVT_KEY_BREAK(BTN_REb):
|
||||
if (!navigationRotaryEncoder(event))
|
||||
break;
|
||||
// no break
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
case EVT_KEY_FIRST(KEY_MENU):
|
||||
if (sub >= 0) {
|
||||
s_curveChan = sub;
|
||||
pushMenu(menuProcCurveOne);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
uint8_t y = 1*FH;
|
||||
uint8_t yd = 1;
|
||||
uint8_t m = 0;
|
||||
for (uint8_t i = 0; i < 7; i++) {
|
||||
uint8_t k = i + s_pgOfs;
|
||||
uint8_t attr = sub == k ? INVERS : 0;
|
||||
#if defined(XCURVES)
|
||||
bool cv9 = (getCurvePoints(k) == 9);
|
||||
#else
|
||||
bool cv9 = k >= MAX_CURVE5;
|
||||
#endif
|
||||
|
||||
if(cv9 && (yd>6)) break;
|
||||
if(yd>7) break;
|
||||
if(!m) m = attr;
|
||||
putsStrIdx(0, y, STR_CV, k+1, attr);
|
||||
int8_t *crv = curveaddress(k);
|
||||
for (uint8_t j = 0; j < (5); j++) {
|
||||
lcd_outdezAtt( j*(3*FW+3) + 7*FW + 2, y, crv[j], 0);
|
||||
}
|
||||
y += FH;yd++;
|
||||
if(cv9){
|
||||
for (uint8_t j = 0; j < 4; j++) {
|
||||
lcd_outdezAtt( j*(3*FW+3) + 7*FW + 2, y, crv[j+5], 0);
|
||||
}
|
||||
y += FH;yd++;
|
||||
}
|
||||
}
|
||||
|
||||
if(!m) s_pgOfs++;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBARM)
|
||||
enum CustomSwitchFields {
|
||||
|
||||
+11
-16
@@ -49,11 +49,11 @@
|
||||
#define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 )
|
||||
|
||||
#if defined(PCBARM)
|
||||
#define EEPROM_VER 210
|
||||
#define EEPROM_VER 211
|
||||
#elif defined(PCBV4)
|
||||
#define EEPROM_VER 209
|
||||
#define EEPROM_VER 210
|
||||
#else
|
||||
#define EEPROM_VER 209
|
||||
#define EEPROM_VER 210
|
||||
#endif
|
||||
|
||||
#ifndef PACK
|
||||
@@ -590,22 +590,16 @@ PACK(typedef struct t_PhaseData {
|
||||
|
||||
#define MAX_TIMERS 2
|
||||
|
||||
#if defined(XCURVES)
|
||||
#if defined(PCBARM)
|
||||
#define MAX_CURVES 16
|
||||
#define NUM_POINTS 256
|
||||
#else
|
||||
#define MAX_CURVES 8
|
||||
#define NUM_POINTS (112-MAX_CURVES)
|
||||
#endif
|
||||
|
||||
#define MIN_POINTS 3
|
||||
#define MAX_POINTS 17
|
||||
#define CURVES_DATA \
|
||||
int8_t curves[MAX_CURVES]; \
|
||||
int8_t points[NUM_POINTS]
|
||||
#else
|
||||
#define MAX_CURVE5 8
|
||||
#define MAX_CURVE9 8
|
||||
#define MAX_CURVES (MAX_CURVE5+MAX_CURVE9)
|
||||
#define CURVES_DATA \
|
||||
int8_t curves5[MAX_CURVE5][5]; \
|
||||
int8_t curves9[MAX_CURVE9][9]
|
||||
#endif
|
||||
|
||||
#define TMRMODE_NONE 0
|
||||
#define TMRMODE_ABS 1
|
||||
@@ -682,7 +676,8 @@ PACK(typedef struct t_ModelData {
|
||||
LimitData limitData[NUM_CHNOUT];
|
||||
ExpoData expoData[MAX_EXPOS];
|
||||
|
||||
CURVES_DATA;
|
||||
int8_t curves[MAX_CURVES];
|
||||
int8_t points[NUM_POINTS];
|
||||
|
||||
CustomSwData customSw[NUM_CSW];
|
||||
FuncSwData funcSw[NUM_FSW];
|
||||
|
||||
+14
-49
@@ -162,7 +162,6 @@ LimitData *limitaddress(uint8_t idx)
|
||||
return &g_model.limitData[idx];
|
||||
}
|
||||
|
||||
#if defined(XCURVES)
|
||||
int8_t *curveaddress(uint8_t idx)
|
||||
{
|
||||
return &g_model.points[idx==0 ? 0 : 5*idx+g_model.curves[idx-1]];
|
||||
@@ -183,12 +182,6 @@ CurveInfo curveinfo(uint8_t idx)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
int8_t *curveaddress(uint8_t idx)
|
||||
{
|
||||
return (idx >= MAX_CURVE5 ? g_model.curves9[idx-MAX_CURVE5] : g_model.curves5[idx]);
|
||||
}
|
||||
#endif
|
||||
|
||||
CustomSwData *cswaddress(uint8_t idx)
|
||||
{
|
||||
@@ -272,7 +265,6 @@ void resetProto()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(XCURVES)
|
||||
int16_t intpol(int16_t x, uint8_t idx) // -100, -75, -50, -25, 0 ,25 ,50, 75, 100
|
||||
{
|
||||
CurveInfo crv = curveinfo(idx);
|
||||
@@ -306,37 +298,6 @@ int16_t intpol(int16_t x, uint8_t idx) // -100, -75, -50, -25, 0 ,25 ,50, 75, 10
|
||||
|
||||
return erg / 25; // 100*D5/RESX;
|
||||
}
|
||||
#else
|
||||
int16_t intpol(int16_t x, uint8_t idx) // -100, -75, -50, -25, 0 ,25 ,50, 75, 100
|
||||
{
|
||||
#define D9 (RESX * 2 / 8)
|
||||
#define D5 (RESX * 2 / 4)
|
||||
bool cv9 = idx >= MAX_CURVE5;
|
||||
int8_t *crv = curveaddress(idx);
|
||||
int16_t erg;
|
||||
|
||||
x+=RESXu;
|
||||
if (x < 0) {
|
||||
erg = (int16_t)crv[0] * (RESX/4);
|
||||
}
|
||||
else if (x >= (RESX*2)) {
|
||||
erg = (int16_t)crv[(cv9 ? 8 : 4)] * (RESX/4);
|
||||
}
|
||||
else {
|
||||
int16_t a,dx;
|
||||
if (cv9) {
|
||||
a = (uint16_t)x / D9;
|
||||
dx =((uint16_t)x % D9) * 2;
|
||||
}
|
||||
else {
|
||||
a = (uint16_t)x / D5;
|
||||
dx = (uint16_t)x % D5;
|
||||
}
|
||||
erg = (int16_t)crv[a]*((D5-dx)/2) + (int16_t)crv[a+1]*(dx/2);
|
||||
}
|
||||
return erg / 25; // 100*D5/RESX;
|
||||
}
|
||||
#endif
|
||||
|
||||
int16_t applyCurve(int16_t x, int8_t idx)
|
||||
{
|
||||
@@ -484,11 +445,7 @@ void applyExpos(int16_t *anas)
|
||||
int16_t k = ed.expo;
|
||||
v = expo(v, k);
|
||||
uint8_t ed_curve = ed.curve;
|
||||
#if defined(XCURVES)
|
||||
if (ed_curve) v = applyCurve(v, ed_curve);
|
||||
#else
|
||||
if (ed_curve) v = applyCurve(v, ed_curve > 10 ? ed_curve + 4 : ed_curve);
|
||||
#endif
|
||||
v = ((int32_t)v * ed.weight) / 100;
|
||||
anas[cur_chn] = v;
|
||||
}
|
||||
@@ -497,7 +454,7 @@ void applyExpos(int16_t *anas)
|
||||
}
|
||||
|
||||
#if !defined(PCBARM)
|
||||
int16_t calc1000toRESX(int16_t x)
|
||||
int16_t calc1000toRESX(int16_t x) // improve calc time by Pat MacKenzie
|
||||
{
|
||||
// return x + x/32 - x/128 + x/512;
|
||||
int16_t y = x>>5;
|
||||
@@ -2771,7 +2728,7 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
|
||||
#else
|
||||
TIMSK &= ~(1<<OCIE0); // stop reentrance
|
||||
#if defined (AUDIO)
|
||||
OCR0 += 2; // interrupt every 128 uS
|
||||
OCR0 += 2; // interrupt every 128us
|
||||
#else
|
||||
static uint8_t accuracyWarble = 4; // because 16M / 1024 / 100 = 156.25. So bump every 4.
|
||||
uint8_t bump = (!(accuracyWarble++ & 0x03)) ? 157 : 156;
|
||||
@@ -2781,8 +2738,16 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
|
||||
|
||||
sei();
|
||||
|
||||
#if defined (PCBSTD) && defined (AUDIO)
|
||||
#if defined(PCBSTD) && (defined(AUDIO) || defined(VOICE))
|
||||
|
||||
#if defined(AUDIO)
|
||||
AUDIO_DRIVER();
|
||||
#endif
|
||||
|
||||
#if defined(VOICE)
|
||||
VOICE_DRIVER();
|
||||
#endif
|
||||
|
||||
static uint8_t cnt10ms = 77; // execute 10ms code once every 78 ISRs
|
||||
if (cnt10ms-- == 0) { // BEGIN { ... every 10ms ... }
|
||||
// Begin 10ms event
|
||||
@@ -2797,7 +2762,7 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
|
||||
|
||||
per10ms();
|
||||
|
||||
#if defined (PCBV4) && defined(SDCARD)
|
||||
#if defined(PCBV4) && defined(SDCARD)
|
||||
sdPoll10mS();
|
||||
#endif
|
||||
|
||||
@@ -2806,13 +2771,13 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (PCBSTD) && defined (AUDIO)
|
||||
#if defined(PCBSTD) && (defined(AUDIO) || defined(VOICE))
|
||||
} // end 10ms event
|
||||
#endif
|
||||
|
||||
cli();
|
||||
|
||||
#if defined (PCBV4)
|
||||
#if defined(PCBV4)
|
||||
TIMSK2 |= (1<<OCIE2A);
|
||||
#else
|
||||
TIMSK |= (1<<OCIE0);
|
||||
|
||||
+2
-11
@@ -42,15 +42,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define VARIANT_XCURVES_MASK 0x80
|
||||
|
||||
#if defined(XCURVES)
|
||||
#define VARIANT_XCURVES VARIANT_XCURVES_MASK
|
||||
#else
|
||||
#define VARIANT_XCURVES 0x00
|
||||
#endif
|
||||
|
||||
#define EEPROM_VARIANTS (VARIANT_XCURVES)
|
||||
#define EEPROM_VARIANTS (0x00)
|
||||
|
||||
#if defined(PCBSTD)
|
||||
#define WDT_RESET_STOCK() wdt_reset()
|
||||
@@ -819,14 +811,13 @@ extern MixData *mixaddress(uint8_t idx);
|
||||
extern LimitData *limitaddress(uint8_t idx);
|
||||
extern int8_t *curveaddress(uint8_t idx);
|
||||
extern CustomSwData *cswaddress(uint8_t idx);
|
||||
#if defined(XCURVES)
|
||||
|
||||
struct CurveInfo {
|
||||
int8_t *crv;
|
||||
uint8_t points;
|
||||
bool custom;
|
||||
};
|
||||
extern CurveInfo curveinfo(uint8_t idx);
|
||||
#endif
|
||||
|
||||
extern void deleteExpoMix(uint8_t expo, uint8_t idx);
|
||||
|
||||
|
||||
+15
-2
@@ -274,11 +274,16 @@ static void EeFsDump(){
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD) && !defined WIN32 && defined __GNUC__
|
||||
#if defined(SDCARD)
|
||||
namespace simu {
|
||||
#include <dirent.h>
|
||||
}
|
||||
#include "FatFs/ff.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
FRESULT f_stat (const TCHAR*, FILINFO*)
|
||||
{
|
||||
return FR_OK;
|
||||
@@ -332,7 +337,15 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil)
|
||||
{
|
||||
simu::dirent * ent = simu::readdir((simu::DIR *)rep->fs);
|
||||
if (!ent) return FR_NO_FILE;
|
||||
if(ent->d_type == simu::DT_DIR) fil->fattrib = AM_DIR; else fil->fattrib = 0;
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
if (ent->d_type == DT_DIR)
|
||||
#else
|
||||
if (ent->d_type == simu::DT_DIR)
|
||||
#endif
|
||||
fil->fattrib = AM_DIR;
|
||||
else
|
||||
fil->fattrib = 0;
|
||||
memset(fil->fname, 0, 13);
|
||||
memset(fil->lfname, 0, SD_SCREEN_FILE_LENGTH);
|
||||
strncpy(fil->fname, ent->d_name, 13-1);
|
||||
|
||||
@@ -76,3 +76,43 @@ inline bool isPlaying()
|
||||
{
|
||||
return Voice.VoiceState != V_IDLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the Voice output
|
||||
* Check for LcdLocked (in interrupt), and voice_enabled
|
||||
*/
|
||||
#define VOICE_DRIVER() \
|
||||
if ( LcdLock == 0 ) /* LCD not in use */ \
|
||||
{ \
|
||||
struct t_voice *vptr; \
|
||||
vptr = voiceaddress(); \
|
||||
if ( vptr->VoiceState == V_CLOCKING ) \
|
||||
{ \
|
||||
if ( vptr->VoiceTimer ) \
|
||||
{ \
|
||||
vptr->VoiceTimer -= 1; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
PORTB |= (1<<OUT_B_LIGHT); /* Latch clock high */ \
|
||||
if ( vptr->VoiceCounter & 1 ) \
|
||||
{ \
|
||||
vptr->VoiceLatch &= ~VOICE_DATA_BIT; \
|
||||
if ( vptr->VoiceSerial & 0x8000 ) \
|
||||
{ \
|
||||
vptr->VoiceLatch |= VOICE_DATA_BIT; \
|
||||
} \
|
||||
vptr->VoiceSerial <<= 1; \
|
||||
} \
|
||||
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 ) \
|
||||
{ \
|
||||
vptr->VoiceState = V_WAIT_BUSY_ON; \
|
||||
vptr->VoiceTimer = 5; /* 50 mS */ \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
@@ -92,11 +92,7 @@ void clearMixes()
|
||||
|
||||
void clearCurves()
|
||||
{
|
||||
#if defined(XCURVES)
|
||||
memclear(g_model.curves, sizeof(g_model.curves) + sizeof(g_model.points)); // clear all curves
|
||||
#else
|
||||
memclear(g_model.curves5, sizeof(g_model.curves5) + sizeof(g_model.curves9)); // clear all curves
|
||||
#endif
|
||||
}
|
||||
|
||||
void setCurve(uint8_t c, const pm_int8_t ar[])
|
||||
|
||||
@@ -57,9 +57,6 @@ const pm_char STR_OPEN9X[] PROGMEM =
|
||||
ISTR(POSNEG)
|
||||
ISTR(VBLMODE)
|
||||
ISTR(VCURVEFUNC)
|
||||
#if !defined(XCURVES)
|
||||
ISTR(CURVMODES)
|
||||
#endif
|
||||
ISTR(EXPLABELS)
|
||||
ISTR(VMLTPX)
|
||||
ISTR(VMLTPX2)
|
||||
|
||||
@@ -84,12 +84,7 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define OFS_POSNEG (OFS_VPROTOS + sizeof(TR_VPROTOS))
|
||||
#define OFS_VBLMODE (OFS_POSNEG + sizeof(TR_POSNEG))
|
||||
#define OFS_VCURVEFUNC (OFS_VBLMODE + sizeof(TR_VBLMODE))
|
||||
#if defined(XCURVES)
|
||||
#define OFS_EXPLABELS (OFS_VCURVEFUNC + sizeof(TR_VCURVEFUNC))
|
||||
#else
|
||||
#define OFS_CURVMODES (OFS_VCURVEFUNC + sizeof(TR_VCURVEFUNC))
|
||||
#define OFS_EXPLABELS (OFS_CURVMODES + sizeof(TR_CURVMODES))
|
||||
#endif
|
||||
#define OFS_VMLTPX (OFS_EXPLABELS + sizeof(TR_EXPLABELS))
|
||||
#define OFS_VMLTPX2 (OFS_VMLTPX + sizeof(TR_VMLTPX))
|
||||
#define OFS_VMIXTRIMS (OFS_VMLTPX2 + sizeof(TR_VMLTPX2))
|
||||
@@ -154,9 +149,6 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define STR_VCURVEFUNC (STR_OPEN9X + OFS_VCURVEFUNC)
|
||||
#define STR_VWHEN STR_VCURVEFUNC
|
||||
#define LEN_VWHEN LEN_VCURVEFUNC
|
||||
#if !defined(XCURVES)
|
||||
#define STR_CURVMODES (STR_OPEN9X + OFS_CURVMODES)
|
||||
#endif
|
||||
#define STR_EXPLABELS (STR_OPEN9X + OFS_EXPLABELS)
|
||||
#define STR_VMLTPX (STR_OPEN9X + OFS_VMLTPX)
|
||||
#define STR_VMLTPX2 (STR_OPEN9X + OFS_VMLTPX2)
|
||||
|
||||
@@ -70,9 +70,6 @@
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_CURVMODES "\005"
|
||||
#define TR_CURVMODES "EDIT ""PRSET"
|
||||
|
||||
#define LEN_EXPLABELS "\006"
|
||||
#ifdef PCBARM
|
||||
#define TR_EXPLABEL_NAME "Jm\202no "
|
||||
|
||||
@@ -70,9 +70,6 @@
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_CURVMODES "\005"
|
||||
#define TR_CURVMODES "EDIT ""PRSET"
|
||||
|
||||
#define LEN_EXPLABELS "\006"
|
||||
#ifdef PCBARM
|
||||
#define TR_EXPLABEL_NAME "Name "
|
||||
|
||||
@@ -70,9 +70,6 @@
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_CURVMODES "\005"
|
||||
#define TR_CURVMODES "EDIT ""PRSET"
|
||||
|
||||
#define LEN_EXPLABELS "\006"
|
||||
#ifdef PCBARM
|
||||
#define TR_EXPLABEL_NAME "Name "
|
||||
|
||||
@@ -65,9 +65,6 @@
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_CURVMODES "\005"
|
||||
#define TR_CURVMODES "EDIT ""PRSET"
|
||||
|
||||
#define LEN_EXPLABELS "\006"
|
||||
#ifdef PCBARM
|
||||
#define TR_EXPLABEL_NAME "Nom "
|
||||
|
||||
@@ -70,9 +70,6 @@
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_CURVMODES "\005"
|
||||
#define TR_CURVMODES "PERS.""PRSET"
|
||||
|
||||
#define LEN_EXPLABELS "\006"
|
||||
#ifdef PCBARM
|
||||
#define TR_EXPLABEL_NAME "Name "
|
||||
|
||||
@@ -65,9 +65,6 @@
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_CURVMODES "\005"
|
||||
#define TR_CURVMODES "EDIT ""PRSET"
|
||||
|
||||
#define LEN_EXPLABELS "\006"
|
||||
#ifdef PCBARM
|
||||
#define TR_EXPLABEL_NAME "Namn "
|
||||
|
||||
Reference in New Issue
Block a user