[sky9x] Bug in SD Init fixed. Temperature alarm added.
This commit is contained in:
+3
-2
@@ -423,7 +423,7 @@ RUN_FROM_FLASH = 1
|
|||||||
ifeq ($(PCB), ARM)
|
ifeq ($(PCB), ARM)
|
||||||
# V4 ARM, so ...
|
# V4 ARM, so ...
|
||||||
OPT = 2
|
OPT = 2
|
||||||
CPPDEFS += -DPCBARM -DAUDIO -DHAPTIC -DVOICE -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
|
CPPDEFS += -DPCBARM -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
|
||||||
EXTRAINCDIRS += ersky9x CoOS/kernel CoOS/portable
|
EXTRAINCDIRS += ersky9x CoOS/kernel CoOS/portable
|
||||||
BOARDSRC = board_ersky9x.cpp
|
BOARDSRC = board_ersky9x.cpp
|
||||||
SRC += ersky9x/core_cm3.c ersky9x/board_lowlevel.c ersky9x/crt.c ersky9x/vectors_sam3s.c
|
SRC += ersky9x/core_cm3.c ersky9x/board_lowlevel.c ersky9x/crt.c ersky9x/vectors_sam3s.c
|
||||||
@@ -435,13 +435,14 @@ ifeq ($(PCB), ARM)
|
|||||||
|
|
||||||
ifeq ($(SDCARD), YES)
|
ifeq ($(SDCARD), YES)
|
||||||
SRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c ersky9x/diskio.c
|
SRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c ersky9x/diskio.c
|
||||||
|
CPPDEFS += -DVOICE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BLUETOOTH), YES)
|
ifeq ($(BLUETOOTH), YES)
|
||||||
MODS:=${MODS}S
|
MODS:=${MODS}S
|
||||||
CPPDEFS += -DBLUETOOTH
|
CPPDEFS += -DBLUETOOTH
|
||||||
CPPSRC += ersky9x/bluetooth.cpp
|
CPPSRC += ersky9x/bluetooth.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
+15
-25
@@ -244,9 +244,8 @@ inline void UART3_Configure( uint32_t baudrate, uint32_t masterClock)
|
|||||||
|
|
||||||
/* Configure baudrate */
|
/* Configure baudrate */
|
||||||
/* Asynchronous, no oversampling */
|
/* Asynchronous, no oversampling */
|
||||||
baudrate = (masterClock * 8 / baudrate) / 16 ;
|
pUart->UART_BRGR = ( (masterClock / baudrate) + 8 ) / 16;
|
||||||
pUart->UART_BRGR = ( baudrate / 8 ) | ( ( baudrate & 7 ) << 16 ) ; // Fractional part to allow 152000 baud
|
|
||||||
//
|
|
||||||
/* Disable PDC channel */
|
/* Disable PDC channel */
|
||||||
pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
|
pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
|
||||||
|
|
||||||
@@ -254,28 +253,11 @@ inline void UART3_Configure( uint32_t baudrate, uint32_t masterClock)
|
|||||||
pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN;
|
pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// TODO when we will want to be BT receiver
|
|
||||||
pUart->UART_IER = UART_IER_RXRDY ;
|
pUart->UART_IER = UART_IER_RXRDY ;
|
||||||
NVIC_EnableIRQ(UART1_IRQn) ;
|
NVIC_EnableIRQ(UART1_IRQn) ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
struct t_serial_tx * Current_bt ;
|
|
||||||
|
|
||||||
extern "C" void UART1_IRQHandler()
|
|
||||||
{
|
|
||||||
Uart *pUart = BT_USART ;
|
|
||||||
if ( pUart->UART_SR & UART_SR_TXBUFE ) {
|
|
||||||
pUart->UART_IDR = UART_IDR_TXBUFE ;
|
|
||||||
pUart->UART_PTCR = US_PTCR_TXTDIS ;
|
|
||||||
Current_bt->ready = 0 ;
|
|
||||||
}
|
|
||||||
/* TODO
|
|
||||||
if ( pUart->UART_SR & UART_SR_RXRDY ) {
|
|
||||||
put_fifo32( &BtRx_fifo, pUart->UART_RHR ) ;
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
|
|
||||||
// USART0 configuration
|
// USART0 configuration
|
||||||
// Work in Progress, UNTESTED
|
// Work in Progress, UNTESTED
|
||||||
// Uses PA5 and PA6 (RXD and TXD)
|
// Uses PA5 and PA6 (RXD and TXD)
|
||||||
@@ -1007,8 +989,8 @@ extern uint32_t keyState(EnumKeys enuk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Analog_values[NUMBER_ANALOG] ;
|
uint16_t Analog_values[NUMBER_ANALOG] ;
|
||||||
uint16_t Temperature ; // Raw temp reading
|
uint8_t temperature ; // Raw temp reading
|
||||||
uint16_t maxTemperature ; // Raw temp reading
|
uint8_t maxTemperature ; // Raw temp reading
|
||||||
|
|
||||||
// Read 8 (9 for REVB) ADC channels
|
// Read 8 (9 for REVB) ADC channels
|
||||||
// Documented bug, must do them 1 by 1
|
// Documented bug, must do them 1 by 1
|
||||||
@@ -1045,9 +1027,9 @@ void read_9_adc()
|
|||||||
Analog_values[8] = ADC->ADC_CDR8 ;
|
Analog_values[8] = ADC->ADC_CDR8 ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Temperature = ( Temperature * 7 + ADC->ADC_CDR15 ) >> 3 ; // Filter it
|
temperature = (((int32_t)temperature * 7) + ((((int32_t)ADC->ADC_CDR15 - 838) * 621) >> 11)) >> 3; // Filter it
|
||||||
if ( Temperature > maxTemperature ) {
|
if (temperature > maxTemperature) {
|
||||||
maxTemperature = Temperature ;
|
maxTemperature = temperature;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1180,6 +1162,13 @@ uint32_t txPdcPending()
|
|||||||
return x ;
|
return x ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void end_bt_tx_interrupt()
|
||||||
|
{
|
||||||
|
Uart *pUart = BT_USART ;
|
||||||
|
pUart->UART_IDR = UART_IDR_TXBUFE ;
|
||||||
|
NVIC_DisableIRQ(UART1_IRQn) ;
|
||||||
|
}
|
||||||
|
|
||||||
void usb_mode()
|
void usb_mode()
|
||||||
{
|
{
|
||||||
// This might be replaced by a software reset
|
// This might be replaced by a software reset
|
||||||
@@ -1187,6 +1176,7 @@ void usb_mode()
|
|||||||
// BEFORE calling sam_boot()
|
// BEFORE calling sam_boot()
|
||||||
stop_rotary_encoder();
|
stop_rotary_encoder();
|
||||||
endPdcUsartReceive() ; // Terminate any serial reception
|
endPdcUsartReceive() ; // Terminate any serial reception
|
||||||
|
end_bt_tx_interrupt() ;
|
||||||
end_ppm_capture() ;
|
end_ppm_capture() ;
|
||||||
end_spi() ;
|
end_spi() ;
|
||||||
end_sound() ;
|
end_sound() ;
|
||||||
|
|||||||
+2
-2
@@ -72,8 +72,8 @@ extern void sdPoll10mS();
|
|||||||
void configure_pins( uint32_t pins, uint16_t config );
|
void configure_pins( uint32_t pins, uint16_t config );
|
||||||
uint16_t getCurrent();
|
uint16_t getCurrent();
|
||||||
|
|
||||||
extern uint16_t Temperature ; // Raw temp reading
|
extern uint8_t temperature ; // Raw temp reading
|
||||||
extern uint16_t maxTemperature ; // Raw temp reading
|
extern uint8_t maxTemperature ; // Raw temp reading
|
||||||
|
|
||||||
#define strcpy_P strcpy
|
#define strcpy_P strcpy
|
||||||
#define strcat_P strcat
|
#define strcat_P strcat
|
||||||
|
|||||||
+16
-4
@@ -33,9 +33,12 @@
|
|||||||
|
|
||||||
#include "../open9x.h"
|
#include "../open9x.h"
|
||||||
|
|
||||||
|
#if defined(SDCARD)
|
||||||
|
|
||||||
const char * audioFilenames[] = {
|
const char * audioFilenames[] = {
|
||||||
"inactiv",
|
"inactiv",
|
||||||
"lowbatt",
|
"lowbatt",
|
||||||
|
"hightemp",
|
||||||
"thralert",
|
"thralert",
|
||||||
"swalert",
|
"swalert",
|
||||||
"eebad",
|
"eebad",
|
||||||
@@ -76,9 +79,8 @@ const char * audioFilenames[] = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t sdAvailableAudioFiles = (1 << AU_TADA);
|
uint32_t sdAvailableAudioFiles = 0;
|
||||||
|
|
||||||
#if defined(SDCARD)
|
|
||||||
// TODO enable the assert when it's C++
|
// TODO enable the assert when it's C++
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void retrieveAvailableAudioFiles()
|
void retrieveAvailableAudioFiles()
|
||||||
@@ -175,6 +177,7 @@ void audioTask(void* pdata)
|
|||||||
{
|
{
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
sdInit();
|
sdInit();
|
||||||
|
AUDIO_TADA();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -477,16 +480,15 @@ void AudioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlag
|
|||||||
CoLeaveMutexSection(audioMutex);
|
CoLeaveMutexSection(audioMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(SDCARD)
|
||||||
void AudioQueue::playFile(const char *filename, uint8_t flags, uint8_t id)
|
void AudioQueue::playFile(const char *filename, uint8_t flags, uint8_t id)
|
||||||
{
|
{
|
||||||
#ifdef SIMU
|
#ifdef SIMU
|
||||||
printf("playFile(\"%s\")\n", filename); fflush(stdout);
|
printf("playFile(\"%s\")\n", filename); fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SDCARD)
|
|
||||||
if (Card_initialized && !sd_card_mounted())
|
if (Card_initialized && !sd_card_mounted())
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
CoEnterMutexSection(audioMutex);
|
CoEnterMutexSection(audioMutex);
|
||||||
|
|
||||||
@@ -508,6 +510,7 @@ void AudioQueue::playFile(const char *filename, uint8_t flags, uint8_t id)
|
|||||||
|
|
||||||
CoLeaveMutexSection(audioMutex);
|
CoLeaveMutexSection(audioMutex);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void audioEvent(uint8_t e, uint8_t f)
|
void audioEvent(uint8_t e, uint8_t f)
|
||||||
{
|
{
|
||||||
@@ -545,9 +548,18 @@ void audioEvent(uint8_t e, uint8_t f)
|
|||||||
audioQueue.play(80, 40, 6, 2, -1);
|
audioQueue.play(80, 40, 6, 2, -1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case AU_TX_TEMP_HIGH:
|
||||||
|
if (!audioQueue.busy()) {
|
||||||
|
// TODO Rob something better here?
|
||||||
|
audioQueue.play(60, 40, 6, 2, 1);
|
||||||
|
audioQueue.play(80, 40, 6, 2, -1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
// error
|
// error
|
||||||
|
#if defined(VOICE)
|
||||||
case AU_THROTTLE_ALERT:
|
case AU_THROTTLE_ALERT:
|
||||||
case AU_SWITCH_ALERT:
|
case AU_SWITCH_ALERT:
|
||||||
|
#endif
|
||||||
case AU_ERROR:
|
case AU_ERROR:
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ, 50, 2, PLAY_NOW);
|
audioQueue.play(BEEP_DEFAULT_FREQ, 50, 2, PLAY_NOW);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -115,8 +115,13 @@ void audioEvent(uint8_t e, uint8_t f=BEEP_DEFAULT_FREQ);
|
|||||||
#define AUDIO_WARNING1() audioEvent(AU_WARNING1)
|
#define AUDIO_WARNING1() audioEvent(AU_WARNING1)
|
||||||
#define AUDIO_WARNING2() audioEvent(AU_WARNING2)
|
#define AUDIO_WARNING2() audioEvent(AU_WARNING2)
|
||||||
#define AUDIO_TX_BATTERY_LOW() audioEvent(AU_TX_BATTERY_LOW)
|
#define AUDIO_TX_BATTERY_LOW() audioEvent(AU_TX_BATTERY_LOW)
|
||||||
|
#define AUDIO_TX_TEMP_HIGH() audioEvent(AU_TX_TEMP_HIGH)
|
||||||
#define AUDIO_ERROR() audioEvent(AU_ERROR)
|
#define AUDIO_ERROR() audioEvent(AU_ERROR)
|
||||||
|
#if defined(VOICE)
|
||||||
#define AUDIO_ERROR_MESSAGE(e) audioEvent(e)
|
#define AUDIO_ERROR_MESSAGE(e) audioEvent(e)
|
||||||
|
#else
|
||||||
|
#define AUDIO_ERROR_MESSAGE(e) audioEvent(AU_ERROR)
|
||||||
|
#endif
|
||||||
#define AUDIO_TIMER_30() audioEvent(AU_TIMER_30)
|
#define AUDIO_TIMER_30() audioEvent(AU_TIMER_30)
|
||||||
#define AUDIO_TIMER_20() audioEvent(AU_TIMER_20)
|
#define AUDIO_TIMER_20() audioEvent(AU_TIMER_20)
|
||||||
#define AUDIO_TIMER_10() audioEvent(AU_TIMER_10)
|
#define AUDIO_TIMER_10() audioEvent(AU_TIMER_10)
|
||||||
|
|||||||
+142
-34
@@ -33,10 +33,15 @@
|
|||||||
|
|
||||||
#include "../open9x.h"
|
#include "../open9x.h"
|
||||||
|
|
||||||
|
void btSetBaudrate(uint32_t index)
|
||||||
|
{
|
||||||
|
uint32_t baudrate = (index==0 ? 115200 : (index==1 ? 9600 : 19200));
|
||||||
|
UART3_Configure(baudrate, Master_frequency);
|
||||||
|
}
|
||||||
|
|
||||||
void btInit()
|
void btInit()
|
||||||
{
|
{
|
||||||
uint32_t baudrate = (g_eeGeneral.btBaudrate==0 ? 115200 : (g_eeGeneral.btBaudrate==1 ? 9600 : 19200));
|
btSetBaudrate(g_eeGeneral.btBaudrate);
|
||||||
UART3_Configure(baudrate, Master_frequency);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Fifo32
|
class Fifo32
|
||||||
@@ -74,12 +79,13 @@ class Fifo32
|
|||||||
};
|
};
|
||||||
|
|
||||||
OS_FlagID btFlag;
|
OS_FlagID btFlag;
|
||||||
Fifo32 btFifo;
|
Fifo32 btTxFifo;
|
||||||
|
Fifo32 btRxFifo;
|
||||||
|
|
||||||
struct t_serial_tx btTx ;
|
struct t_serial_tx btTx ;
|
||||||
uint8_t btTxBuffer[32] ;
|
uint8_t btTxBuffer[32] ;
|
||||||
|
|
||||||
extern struct t_serial_tx * Current_bt ;
|
struct t_serial_tx * Current_bt ;
|
||||||
|
|
||||||
uint32_t txPdcBt(struct t_serial_tx *data)
|
uint32_t txPdcBt(struct t_serial_tx *data)
|
||||||
{
|
{
|
||||||
@@ -100,6 +106,27 @@ uint32_t txPdcBt(struct t_serial_tx *data)
|
|||||||
return 0 ; // Busy
|
return 0 ; // Busy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void UART1_IRQHandler()
|
||||||
|
{
|
||||||
|
Uart *pUart = BT_USART ;
|
||||||
|
if ( pUart->UART_SR & UART_SR_TXBUFE ) {
|
||||||
|
pUart->UART_IDR = UART_IDR_TXBUFE ;
|
||||||
|
pUart->UART_PTCR = US_PTCR_TXTDIS ;
|
||||||
|
Current_bt->ready = 0 ;
|
||||||
|
}
|
||||||
|
if ( pUart->UART_SR & UART_SR_RXRDY ) {
|
||||||
|
btRxFifo.push(pUart->UART_RHR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t rxBtuart()
|
||||||
|
{
|
||||||
|
uint8_t result;
|
||||||
|
if (!btRxFifo.pop(result))
|
||||||
|
return 0xffff;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void btSendBuffer()
|
void btSendBuffer()
|
||||||
{
|
{
|
||||||
@@ -111,46 +138,93 @@ void btSendBuffer()
|
|||||||
btTx.size = 0;
|
btTx.size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void btPollDevice()
|
#define BT_POLL_TIMEOUT 500
|
||||||
|
|
||||||
|
uint32_t btChangeBaudrate( uint32_t baudIndex )
|
||||||
{
|
{
|
||||||
#if 0
|
uint16_t x ;
|
||||||
uint16_t x;
|
uint32_t y ;
|
||||||
uint32_t y;
|
uint16_t rxchar ;
|
||||||
uint16_t rxchar;
|
|
||||||
|
|
||||||
x = 'O';
|
x = 4 ; // 9600
|
||||||
#endif
|
if ( baudIndex == 0 )
|
||||||
|
{
|
||||||
btTxBuffer[0] = 'A';
|
x = 8 ; // 115200
|
||||||
btTxBuffer[1] = 'T';
|
}
|
||||||
btTx.size = 2;
|
else if ( baudIndex == 2 )
|
||||||
btSendBuffer();
|
{
|
||||||
|
x = 5 ; // 19200
|
||||||
#if 0
|
}
|
||||||
for (y = 0; y < 300; y += 1) {
|
btTxBuffer[0] = 'A' ;
|
||||||
if ((rxchar = rxBtuart()) != 0xFFFF) {
|
btTxBuffer[1] = 'T' ;
|
||||||
if (rxchar == x) {
|
btTxBuffer[2] = '+' ;
|
||||||
if (x == 'O') {
|
btTxBuffer[3] = 'B' ;
|
||||||
x = 'K';
|
btTxBuffer[4] = 'A' ;
|
||||||
|
btTxBuffer[5] = 'U' ;
|
||||||
|
btTxBuffer[6] = 'D' ;
|
||||||
|
btTxBuffer[7] = '0' + x ;
|
||||||
|
btTx.size = 8 ;
|
||||||
|
btSendBuffer() ;
|
||||||
|
x = 'O' ;
|
||||||
|
for( y = 0 ; y < BT_POLL_TIMEOUT ; y += 1 ) {
|
||||||
|
if ( ( rxchar = rxBtuart() ) != 0xFFFF ) {
|
||||||
|
if ( rxchar == x ) {
|
||||||
|
if ( x == 'O' ) {
|
||||||
|
x = 'K' ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
break; // Found "OK"
|
break ; // Found "OK"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CoTickDelay(1); // 2mS
|
CoTickDelay(1) ; // 2mS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (y < 300) {
|
|
||||||
return 1;
|
if ( y < BT_POLL_TIMEOUT ) {
|
||||||
|
return 1 ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 0;
|
return 0 ;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t btPollDevice()
|
||||||
|
{
|
||||||
|
uint16_t x ;
|
||||||
|
uint32_t y ;
|
||||||
|
uint16_t rxchar ;
|
||||||
|
|
||||||
|
x = 'O' ;
|
||||||
|
btTxBuffer[0] = 'A' ;
|
||||||
|
btTxBuffer[1] = 'T' ;
|
||||||
|
btTx.size = 2 ;
|
||||||
|
btSendBuffer() ;
|
||||||
|
|
||||||
|
for( y = 0 ; y < BT_POLL_TIMEOUT ; y++) {
|
||||||
|
if ( ( rxchar = rxBtuart() ) != 0xFFFF ) {
|
||||||
|
if ( rxchar == x ) {
|
||||||
|
if ( x == 'O' ) {
|
||||||
|
x = 'K' ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break ; // Found "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CoTickDelay(1) ; // 2mS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( y < BT_POLL_TIMEOUT ) {
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Commands to BT module
|
Commands to BT module
|
||||||
@@ -178,6 +252,8 @@ Then we can change the baudrate to the required value.
|
|||||||
Or maybe just AT and get OK back
|
Or maybe just AT and get OK back
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
uint32_t btStatus;
|
||||||
|
|
||||||
void btTask(void* pdata)
|
void btTask(void* pdata)
|
||||||
{
|
{
|
||||||
uint8_t byte;
|
uint8_t byte;
|
||||||
@@ -185,9 +261,41 @@ void btTask(void* pdata)
|
|||||||
btFlag = CoCreateFlag(true, false);
|
btFlag = CoCreateFlag(true, false);
|
||||||
btTx.size = 0;
|
btTx.size = 0;
|
||||||
|
|
||||||
// Look for BT module baudrate, try 115200, and 9600
|
// Look for BT module baudrate, try 115200, and 9600
|
||||||
// Already initialised to g_eeGeneral.bt_baudrate
|
// Already initialised to g_eeGeneral.bt_baudrate
|
||||||
// 0 : 115200, 1 : 9600, 2 : 19200
|
// 0 : 115200, 1 : 9600, 2 : 19200
|
||||||
|
|
||||||
|
uint32_t x = g_eeGeneral.btBaudrate;
|
||||||
|
|
||||||
|
btStatus = btPollDevice() ; // Do we get a response?
|
||||||
|
|
||||||
|
for (int y=0; y<2; y++) {
|
||||||
|
if (btStatus == 0) {
|
||||||
|
x += 1 ;
|
||||||
|
if (x > 2) {
|
||||||
|
x = 0 ;
|
||||||
|
}
|
||||||
|
btSetBaudrate(x) ;
|
||||||
|
CoTickDelay(1) ; // 2mS
|
||||||
|
btStatus = btPollDevice() ; // Do we get a response?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (btStatus) {
|
||||||
|
btStatus = x + 1 ;
|
||||||
|
if ( x != g_eeGeneral.btBaudrate ) {
|
||||||
|
x = g_eeGeneral.btBaudrate ;
|
||||||
|
// Need to change Bt Baudrate
|
||||||
|
btChangeBaudrate( x ) ;
|
||||||
|
btStatus += (x+1) * 10 ;
|
||||||
|
btSetBaudrate( x ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
btInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
CoTickDelay(1) ;
|
||||||
|
|
||||||
btPollDevice(); // Do we get a response?
|
btPollDevice(); // Do we get a response?
|
||||||
|
|
||||||
@@ -195,7 +303,7 @@ void btTask(void* pdata)
|
|||||||
uint32_t x = CoWaitForSingleFlag(btFlag, 10); // Wait for data in Fifo
|
uint32_t x = CoWaitForSingleFlag(btFlag, 10); // Wait for data in Fifo
|
||||||
if (x == E_OK) {
|
if (x == E_OK) {
|
||||||
// We have some data in the Fifo
|
// We have some data in the Fifo
|
||||||
while (btFifo.pop(byte)) {
|
while (btTxFifo.pop(byte)) {
|
||||||
btTxBuffer[btTx.size++] = byte;
|
btTxBuffer[btTx.size++] = byte;
|
||||||
if (btTx.size > 31) {
|
if (btTx.size > 31) {
|
||||||
btSendBuffer();
|
btSendBuffer();
|
||||||
@@ -210,6 +318,6 @@ void btTask(void* pdata)
|
|||||||
|
|
||||||
void btPushByte(uint8_t data)
|
void btPushByte(uint8_t data)
|
||||||
{
|
{
|
||||||
btFifo.push(data);
|
btTxFifo.push(data);
|
||||||
CoSetFlag(btFlag); // Tell the Bt task something to do
|
CoSetFlag(btFlag); // Tell the Bt task something to do
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -512,7 +512,7 @@
|
|||||||
#define SD_ST_MOUNTED 10
|
#define SD_ST_MOUNTED 10
|
||||||
|
|
||||||
extern int32_t Card_state;
|
extern int32_t Card_state;
|
||||||
extern uint32_t Card_initialized;
|
extern volatile uint32_t Card_initialized;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define BOARD_PSRAM_PINS PIN_EBI_DATA_BUS, PIN_EBI_NCS0, PIN_EBI_NRD, PIN_EBI_NWE, \
|
#define BOARD_PSRAM_PINS PIN_EBI_DATA_BUS, PIN_EBI_NCS0, PIN_EBI_NRD, PIN_EBI_NWE, \
|
||||||
|
|||||||
+16
-5
@@ -70,7 +70,7 @@ uint32_t Card_ID[4] ;
|
|||||||
uint32_t Card_SCR[2] ;
|
uint32_t Card_SCR[2] ;
|
||||||
uint32_t Card_CSD[4] ;
|
uint32_t Card_CSD[4] ;
|
||||||
int32_t Card_state = SD_ST_STARTUP ;
|
int32_t Card_state = SD_ST_STARTUP ;
|
||||||
uint32_t Card_initialized = 0;
|
volatile uint32_t Card_initialized = 0;
|
||||||
uint32_t Sd_128_resp[4] ;
|
uint32_t Sd_128_resp[4] ;
|
||||||
uint32_t Sd_rca ;
|
uint32_t Sd_rca ;
|
||||||
uint32_t Cmd_8_resp ;
|
uint32_t Cmd_8_resp ;
|
||||||
@@ -873,13 +873,21 @@ void sdInit()
|
|||||||
|
|
||||||
if (!CardIsConnected()) {
|
if (!CardIsConnected()) {
|
||||||
Card_state = SD_ST_EMPTY;
|
Card_state = SD_ST_EMPTY;
|
||||||
|
Card_initialized = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdCmd0();
|
sdCmd0();
|
||||||
|
CoTickDelay(5); // 10ms
|
||||||
sdCmd8(1);
|
sdCmd8(1);
|
||||||
sdMemInit(1, &Cmd_A41_resp);
|
sdMemInit(1, &Cmd_A41_resp);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// sdAvailableAudioFiles = 0;
|
||||||
|
Card_state = SD_ST_READY;
|
||||||
|
Card_initialized = 1;
|
||||||
|
#else
|
||||||
|
|
||||||
uint8_t retry;
|
uint8_t retry;
|
||||||
for (retry=0; retry<10; retry++) {
|
for (retry=0; retry<10; retry++) {
|
||||||
if (!sdCmd2()) break;
|
if (!sdCmd2()) break;
|
||||||
@@ -888,6 +896,7 @@ void sdInit()
|
|||||||
|
|
||||||
if (retry == 10) {
|
if (retry == 10) {
|
||||||
Card_state = SD_ST_READY;
|
Card_state = SD_ST_READY;
|
||||||
|
Card_initialized = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,6 +907,7 @@ void sdInit()
|
|||||||
|
|
||||||
if (retry == 10) {
|
if (retry == 10) {
|
||||||
Card_state = SD_ST_IDENT;
|
Card_state = SD_ST_IDENT;
|
||||||
|
Card_initialized = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -910,10 +920,11 @@ void sdInit()
|
|||||||
// Should check the card can do this ****
|
// Should check the card can do this ****
|
||||||
Card_state = SD_ST_DATA;
|
Card_state = SD_ST_DATA;
|
||||||
|
|
||||||
f_mount(0, &g_FATFS_Obj);
|
if (f_mount(0, &g_FATFS_Obj) == FR_OK) {
|
||||||
retrieveAvailableAudioFiles();
|
retrieveAvailableAudioFiles();
|
||||||
Card_state = SD_ST_MOUNTED;
|
Card_state = SD_ST_MOUNTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Card_initialized = 1;
|
Card_initialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-1
@@ -136,6 +136,10 @@ enum menuProcSetupItems {
|
|||||||
#endif
|
#endif
|
||||||
ITEM_SETUP_CONTRAST,
|
ITEM_SETUP_CONTRAST,
|
||||||
ITEM_SETUP_BATTERY_WARNING,
|
ITEM_SETUP_BATTERY_WARNING,
|
||||||
|
#if defined(PCBARM)
|
||||||
|
ITEM_SETUP_CAPACITY_WARNING,
|
||||||
|
ITEM_SETUP_TEMPERATURE_WARNING,
|
||||||
|
#endif
|
||||||
ITEM_SETUP_INACTIVITY_ALARM,
|
ITEM_SETUP_INACTIVITY_ALARM,
|
||||||
#if defined(BLUETOOTH)
|
#if defined(BLUETOOTH)
|
||||||
ITEM_SETUP_BT_BAUDRATE,
|
ITEM_SETUP_BT_BAUDRATE,
|
||||||
@@ -192,7 +196,7 @@ void menuProcSetup(uint8_t event)
|
|||||||
#define FRSKY_ZEROS
|
#define FRSKY_ZEROS
|
||||||
#endif
|
#endif
|
||||||
#ifdef PCBARM
|
#ifdef PCBARM
|
||||||
#define ARM_ZEROS 0, 0,
|
#define ARM_ZEROS 0, 0, 0, 0,
|
||||||
#else
|
#else
|
||||||
#define ARM_ZEROS
|
#define ARM_ZEROS
|
||||||
#endif
|
#endif
|
||||||
@@ -317,6 +321,20 @@ void menuProcSetup(uint8_t event)
|
|||||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(PCBARM)
|
||||||
|
case ITEM_SETUP_CAPACITY_WARNING:
|
||||||
|
lcd_putsLeft(y, STR_CAPAWARNING);
|
||||||
|
putsTelemetryValue(GENERAL_PARAM_OFS, y, g_eeGeneral.mAhWarn*50, UNIT_MAH, attr|LEFT) ;
|
||||||
|
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.mAhWarn, 0, 100);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_SETUP_TEMPERATURE_WARNING:
|
||||||
|
lcd_putsLeft(y, STR_TEMPWARNING);
|
||||||
|
putsTelemetryValue(GENERAL_PARAM_OFS, y, 80+g_eeGeneral.temperatureWarn, UNIT_DEGREES, attr|LEFT) ;
|
||||||
|
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureWarn, -80, 40); // 0-120degrees
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case ITEM_SETUP_INACTIVITY_ALARM:
|
case ITEM_SETUP_INACTIVITY_ALARM:
|
||||||
lcd_putsLeft( y,STR_INACTIVITYALARM);
|
lcd_putsLeft( y,STR_INACTIVITYALARM);
|
||||||
lcd_outdezAtt(GENERAL_PARAM_OFS, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
lcd_outdezAtt(GENERAL_PARAM_OFS, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
||||||
|
|||||||
+3
-3
@@ -730,7 +730,7 @@ void lcdSendCtl(uint8_t val)
|
|||||||
pioptr->PIO_SODR = LCD_E ; // Start E pulse
|
pioptr->PIO_SODR = LCD_E ; // Start E pulse
|
||||||
// Need a delay here (250nS)
|
// Need a delay here (250nS)
|
||||||
TC0->TC_CHANNEL[0].TC_CCR = 5 ; // Enable clock and trigger it (may only need trigger)
|
TC0->TC_CHANNEL[0].TC_CCR = 5 ; // Enable clock and trigger it (may only need trigger)
|
||||||
while ( TC0->TC_CHANNEL[0].TC_CV < 3 ) // Value depends on MCK/2 (used 6MHz)
|
while ( TC0->TC_CHANNEL[0].TC_CV < 9 ) // Value depends on MCK/2 (used 18MHz)
|
||||||
{
|
{
|
||||||
// Wait
|
// Wait
|
||||||
}
|
}
|
||||||
@@ -768,13 +768,13 @@ void lcd_init()
|
|||||||
|
|
||||||
pioptr->PIO_CODR = LCD_RES ; // Reset LCD
|
pioptr->PIO_CODR = LCD_RES ; // Reset LCD
|
||||||
TC0->TC_CHANNEL[0].TC_CCR = 5 ; // Enable clock and trigger it (may only need trigger)
|
TC0->TC_CHANNEL[0].TC_CCR = 5 ; // Enable clock and trigger it (may only need trigger)
|
||||||
while ( TC0->TC_CHANNEL[0].TC_CV < 12 ) // 2 uS, Value depends on MCK/2 (used 6MHz)
|
while ( TC0->TC_CHANNEL[0].TC_CV < 200 ) // > 10us, Value depends on MCK/2 (used 18MHz)
|
||||||
{
|
{
|
||||||
// Wait
|
// Wait
|
||||||
}
|
}
|
||||||
pioptr->PIO_SODR = LCD_RES ; // Remove LCD reset
|
pioptr->PIO_SODR = LCD_RES ; // Remove LCD reset
|
||||||
TC0->TC_CHANNEL[0].TC_CCR = 5 ; // Enable clock and trigger it (may only need trigger)
|
TC0->TC_CHANNEL[0].TC_CCR = 5 ; // Enable clock and trigger it (may only need trigger)
|
||||||
while ( TC0->TC_CHANNEL[0].TC_CV < 9000 ) // 1500 uS, Value depends on MCK/2 (used 6MHz)
|
while ( TC0->TC_CHANNEL[0].TC_CV < 27000 ) // 1500us, Value depends on MCK/2 (used 18MHz)
|
||||||
{
|
{
|
||||||
// Wait
|
// Wait
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-3
@@ -96,10 +96,13 @@ enum BeeperMode {
|
|||||||
uint8_t speakerVolume; \
|
uint8_t speakerVolume; \
|
||||||
uint8_t backlightBright; \
|
uint8_t backlightBright; \
|
||||||
int8_t currentCalib;
|
int8_t currentCalib;
|
||||||
#define EXTRA_NON_ARM_FIELDS
|
#define EXTRA_GENERAL_FIELDS \
|
||||||
|
int8_t temperatureWarn; \
|
||||||
|
uint8_t mAhWarn; \
|
||||||
|
uint16_t mAhUsed;
|
||||||
#else
|
#else
|
||||||
#define EXTRA_ARM_FIELDS
|
#define EXTRA_ARM_FIELDS
|
||||||
#define EXTRA_NON_ARM_FIELDS \
|
#define EXTRA_GENERAL_FIELDS \
|
||||||
int8_t speakerVolume;
|
int8_t speakerVolume;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -163,7 +166,8 @@ PACK(typedef struct t_EEGeneral {
|
|||||||
|
|
||||||
uint8_t variants;
|
uint8_t variants;
|
||||||
|
|
||||||
EXTRA_NON_ARM_FIELDS;
|
EXTRA_GENERAL_FIELDS
|
||||||
|
|
||||||
}) EEGeneral;
|
}) EEGeneral;
|
||||||
|
|
||||||
// eeprom modelspec
|
// eeprom modelspec
|
||||||
|
|||||||
+35
-27
@@ -924,11 +924,11 @@ void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t
|
|||||||
|
|
||||||
void clearKeyEvents()
|
void clearKeyEvents()
|
||||||
{
|
{
|
||||||
#if defined(PCBARM) && !defined(SIMU)
|
#if defined(PCBARM)
|
||||||
CoTickDelay(100); // 200ms
|
CoTickDelay(100); // 200ms
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SIMU
|
#if defined(SIMU)
|
||||||
while (keyDown() && main_thread_running) sleep(1/*ms*/);
|
while (keyDown() && main_thread_running) sleep(1/*ms*/);
|
||||||
#else
|
#else
|
||||||
while (keyDown()) WDT_RESET_STOCK(); // loop until all keys are up
|
while (keyDown()) WDT_RESET_STOCK(); // loop until all keys are up
|
||||||
@@ -982,7 +982,9 @@ void doSplash()
|
|||||||
lcd_img(0, 0, splash_lbm, 0, 0);
|
lcd_img(0, 0, splash_lbm, 0, 0);
|
||||||
refreshDisplay();
|
refreshDisplay();
|
||||||
|
|
||||||
|
#if !defined(PCBARM)
|
||||||
AUDIO_TADA();
|
AUDIO_TADA();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(PCBSTD)
|
#if defined(PCBSTD)
|
||||||
lcdSetContrast();
|
lcdSetContrast();
|
||||||
@@ -992,7 +994,7 @@ void doSplash()
|
|||||||
lcdSetRefVolt(contrast);
|
lcdSetRefVolt(contrast);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMU
|
#if !defined(SIMU)
|
||||||
for(uint8_t i=0; i<32; i++)
|
for(uint8_t i=0; i<32; i++)
|
||||||
getADC_filt(); // init ADC array
|
getADC_filt(); // init ADC array
|
||||||
#endif
|
#endif
|
||||||
@@ -2704,6 +2706,11 @@ void perMain()
|
|||||||
if (g_vbat100mV <= g_eeGeneral.vBatWarn && g_vbat100mV>50) {
|
if (g_vbat100mV <= g_eeGeneral.vBatWarn && g_vbat100mV>50) {
|
||||||
AUDIO_TX_BATTERY_LOW();
|
AUDIO_TX_BATTERY_LOW();
|
||||||
}
|
}
|
||||||
|
#if defined(PCBARM)
|
||||||
|
if (temperature >= g_eeGeneral.temperatureWarn+80) {
|
||||||
|
AUDIO_TX_TEMP_HIGH();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3131,13 +3138,11 @@ inline void open9xInit(OPEN9X_INIT_ARGS)
|
|||||||
if (!UNEXPECTED_SHUTDOWN()) {
|
if (!UNEXPECTED_SHUTDOWN()) {
|
||||||
doSplash();
|
doSplash();
|
||||||
|
|
||||||
#if defined(PCBARM)
|
#if defined(PCBARM) && defined(SDCARD)
|
||||||
#if defined(SDCARD)
|
for (int i=0; i<200 && !Card_initialized; i++) {
|
||||||
while (!Card_initialized) {
|
|
||||||
CoTickDelay(1); // 2ms
|
CoTickDelay(1); // 2ms
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(PCBARM)
|
#if !defined(PCBARM)
|
||||||
checkLowEEPROM();
|
checkLowEEPROM();
|
||||||
@@ -3633,19 +3638,21 @@ void menusTask(void * pdata)
|
|||||||
closeLogs();
|
closeLogs();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SysTick->CTRL = 0; // turn off systick
|
||||||
|
|
||||||
#if defined(HAPTIC)
|
#if defined(HAPTIC)
|
||||||
hapticOff();
|
hapticOff();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SysTick->CTRL = 0; // turn off systick
|
lcd_clear() ;
|
||||||
|
|
||||||
|
if (shutdown_state != e_power_usb) {
|
||||||
|
displayPopup(STR_SHUTDOWN);
|
||||||
|
g_eeGeneral.unexpectedShutdown=0;
|
||||||
|
eeDirty(EE_GENERAL);
|
||||||
|
eeCheck(true);
|
||||||
|
}
|
||||||
|
|
||||||
lcd_clear() ;
|
|
||||||
displayPopup(STR_SHUTDOWN);
|
|
||||||
g_eeGeneral.unexpectedShutdown=0;
|
|
||||||
eeDirty(EE_GENERAL);
|
|
||||||
eeCheck(true);
|
|
||||||
lcd_clear() ;
|
|
||||||
refreshDisplay() ;
|
|
||||||
soft_power_off(); // Only turn power off if necessary
|
soft_power_off(); // Only turn power off if necessary
|
||||||
|
|
||||||
if (shutdown_state == e_power_usb) {
|
if (shutdown_state == e_power_usb) {
|
||||||
@@ -3656,18 +3663,19 @@ void menusTask(void * pdata)
|
|||||||
#ifdef MASSSTORAGE
|
#ifdef MASSSTORAGE
|
||||||
if (mass_storage) {
|
if (mass_storage) {
|
||||||
stop_rotary_encoder();
|
stop_rotary_encoder();
|
||||||
endPdcUsartReceive() ; // Terminate any serial reception
|
endPdcUsartReceive() ; // Terminate any serial reception
|
||||||
end_ppm_capture() ;
|
end_bt_tx_interrupt() ;
|
||||||
end_spi() ;
|
end_ppm_capture() ;
|
||||||
end_sound() ;
|
end_spi() ;
|
||||||
TC0->TC_CHANNEL[2].TC_IDR = TC_IDR0_CPCS ;
|
end_sound() ;
|
||||||
NVIC_DisableIRQ(TC2_IRQn) ;
|
TC0->TC_CHANNEL[2].TC_IDR = TC_IDR0_CPCS ;
|
||||||
// PWM->PWM_IDR1 = PWM_IDR1_CHID0 ;
|
NVIC_DisableIRQ(TC2_IRQn) ;
|
||||||
disable_main_ppm() ;
|
// PWM->PWM_IDR1 = PWM_IDR1_CHID0 ;
|
||||||
// PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
|
disable_main_ppm() ;
|
||||||
// NVIC_DisableIRQ(PWM_IRQn) ;
|
// PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
|
||||||
disable_ssc() ;
|
// NVIC_DisableIRQ(PWM_IRQn) ;
|
||||||
usbMassStorage();
|
disable_ssc() ;
|
||||||
|
usbMassStorage();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -964,6 +964,9 @@ extern uint16_t jeti_keys;
|
|||||||
enum AUDIO_SOUNDS {
|
enum AUDIO_SOUNDS {
|
||||||
AU_INACTIVITY,
|
AU_INACTIVITY,
|
||||||
AU_TX_BATTERY_LOW,
|
AU_TX_BATTERY_LOW,
|
||||||
|
#if defined(PCBARM)
|
||||||
|
AU_TX_TEMP_HIGH,
|
||||||
|
#endif
|
||||||
#if defined(VOICE)
|
#if defined(VOICE)
|
||||||
AU_THROTTLE_ALERT,
|
AU_THROTTLE_ALERT,
|
||||||
AU_SWITCH_ALERT,
|
AU_SWITCH_ALERT,
|
||||||
|
|||||||
+2
-2
@@ -274,8 +274,8 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
|
|||||||
ERSKY9X_EXIT_PIO->PIO_PDSR |= ERSKY9X_EXIT_MASK;
|
ERSKY9X_EXIT_PIO->PIO_PDSR |= ERSKY9X_EXIT_MASK;
|
||||||
PIOB->PIO_PDSR |= ERSKY9X_MENU_MASK;
|
PIOB->PIO_PDSR |= ERSKY9X_MENU_MASK;
|
||||||
// PIOA->PIO_PDSR = 0xFFFFFFFF;
|
// PIOA->PIO_PDSR = 0xFFFFFFFF;
|
||||||
Temperature = 1000;
|
temperature = 67;
|
||||||
maxTemperature = 1500;
|
maxTemperature = 70;
|
||||||
|
|
||||||
#elif defined(PCBV4)
|
#elif defined(PCBV4)
|
||||||
uint8_t pin = (pinl & ~0x3f);
|
uint8_t pin = (pinl & ~0x3f);
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ void menuProcDebug(uint8_t event)
|
|||||||
#if defined(PCBARM)
|
#if defined(PCBARM)
|
||||||
#if defined(REVB)
|
#if defined(REVB)
|
||||||
lcd_putsLeft(2*FH, STR_CURRENT);
|
lcd_putsLeft(2*FH, STR_CURRENT);
|
||||||
putsTelemetryValue(MENU_DEBUG_COL_OFS, 2*FH, getCurrent(), UNIT_MILLIAMPS, 0) ;
|
putsTelemetryValue(MENU_DEBUG_COL_OFS, 2*FH, getCurrent(), UNIT_MILLIAMPS, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcd_putsLeft(3*FH, STR_CPU_TEMP);
|
lcd_putsLeft(3*FH, STR_CPU_TEMP);
|
||||||
putsTelemetryValue(MENU_DEBUG_COL_OFS, 3*FH, (((((int32_t)Temperature - 838 ) * 621 ) >> 11 ) - 20), UNIT_DEGREES, 0 ) ;
|
putsTelemetryValue(MENU_DEBUG_COL_OFS, 3*FH, temperature, UNIT_DEGREES, 0);
|
||||||
putsTelemetryValue(20*FW+2, 3*FH, (((((int32_t)maxTemperature - 838 ) * 621 ) >> 11 ) - 20), UNIT_DEGREES, 0 ) ;
|
putsTelemetryValue(20*FW+2, 3*FH, maxTemperature, UNIT_DEGREES, 0);
|
||||||
// TODO mAh, Battery from ersky9x?
|
// TODO mAh, Battery from ersky9x?
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -338,6 +338,8 @@ const pm_char STR_SPEAKER_VOLUME[] PROGMEM = TR_SPEAKER_VOLUME;
|
|||||||
const pm_char STR_OPTREX_DISPLAY[] PROGMEM = TR_OPTREX_DISPLAY;
|
const pm_char STR_OPTREX_DISPLAY[] PROGMEM = TR_OPTREX_DISPLAY;
|
||||||
const pm_char STR_BRIGHTNESS[] PROGMEM = TR_BRIGHTNESS;
|
const pm_char STR_BRIGHTNESS[] PROGMEM = TR_BRIGHTNESS;
|
||||||
const pm_char STR_CPU_TEMP[] PROGMEM = TR_CPU_TEMP;
|
const pm_char STR_CPU_TEMP[] PROGMEM = TR_CPU_TEMP;
|
||||||
|
const pm_char STR_TEMPWARNING[] PROGMEM = TR_TEMPWARNING;
|
||||||
|
const pm_char STR_CAPAWARNING[] PROGMEM = TR_CAPAWARNING;
|
||||||
const pm_char STR_FUNC[] PROGMEM = TR_FUNC;
|
const pm_char STR_FUNC[] PROGMEM = TR_FUNC;
|
||||||
const pm_char STR_V1[] PROGMEM = TR_V1;
|
const pm_char STR_V1[] PROGMEM = TR_V1;
|
||||||
const pm_char STR_V2[] PROGMEM = TR_V2;
|
const pm_char STR_V2[] PROGMEM = TR_V2;
|
||||||
|
|||||||
@@ -420,6 +420,8 @@ extern const pm_char STR_SPEAKER_VOLUME[];
|
|||||||
extern const pm_char STR_OPTREX_DISPLAY[];
|
extern const pm_char STR_OPTREX_DISPLAY[];
|
||||||
extern const pm_char STR_BRIGHTNESS[];
|
extern const pm_char STR_BRIGHTNESS[];
|
||||||
extern const pm_char STR_CPU_TEMP[];
|
extern const pm_char STR_CPU_TEMP[];
|
||||||
|
extern const pm_char STR_CAPAWARNING[];
|
||||||
|
extern const pm_char STR_TEMPWARNING[];
|
||||||
extern const pm_char STR_FUNC[];
|
extern const pm_char STR_FUNC[];
|
||||||
extern const pm_char STR_V1[];
|
extern const pm_char STR_V1[];
|
||||||
extern const pm_char STR_V2[];
|
extern const pm_char STR_V2[];
|
||||||
|
|||||||
@@ -423,6 +423,8 @@
|
|||||||
#define TR_OPTREX_DISPLAY "Optrex Display"
|
#define TR_OPTREX_DISPLAY "Optrex Display"
|
||||||
#define TR_BRIGHTNESS "Jas"
|
#define TR_BRIGHTNESS "Jas"
|
||||||
#define TR_CPU_TEMP "tepl. CPU\010>"
|
#define TR_CPU_TEMP "tepl. CPU\010>"
|
||||||
|
#define TR_CAPAWARNING "Capacity Warning"
|
||||||
|
#define TR_TEMPWARNING "Temp Warning"
|
||||||
#define TR_FUNC "Fun."
|
#define TR_FUNC "Fun."
|
||||||
#define TR_V1 "V1"
|
#define TR_V1 "V1"
|
||||||
#define TR_V2 "V2"
|
#define TR_V2 "V2"
|
||||||
|
|||||||
@@ -423,6 +423,8 @@
|
|||||||
#define TR_OPTREX_DISPLAY "Optrex Display"
|
#define TR_OPTREX_DISPLAY "Optrex Display"
|
||||||
#define TR_BRIGHTNESS "Brightness"
|
#define TR_BRIGHTNESS "Brightness"
|
||||||
#define TR_CPU_TEMP "CPU temp.\010>"
|
#define TR_CPU_TEMP "CPU temp.\010>"
|
||||||
|
#define TR_CAPAWARNING "Capacity Warning"
|
||||||
|
#define TR_TEMPWARNING "Temp Warning"
|
||||||
#define TR_FUNC "Func"
|
#define TR_FUNC "Func"
|
||||||
#define TR_V1 "V1"
|
#define TR_V1 "V1"
|
||||||
#define TR_V2 "V2"
|
#define TR_V2 "V2"
|
||||||
|
|||||||
@@ -424,6 +424,8 @@
|
|||||||
#define TR_OPTREX_DISPLAY "Optrex Display"
|
#define TR_OPTREX_DISPLAY "Optrex Display"
|
||||||
#define TR_BRIGHTNESS "Brightness"
|
#define TR_BRIGHTNESS "Brightness"
|
||||||
#define TR_CPU_TEMP "CPU temp.\010>"
|
#define TR_CPU_TEMP "CPU temp.\010>"
|
||||||
|
#define TR_CAPAWARNING "Capacity Warning"
|
||||||
|
#define TR_TEMPWARNING "Temp Warning"
|
||||||
#define TR_FUNC "Func"
|
#define TR_FUNC "Func"
|
||||||
#define TR_V1 "V1"
|
#define TR_V1 "V1"
|
||||||
#define TR_V2 "V2"
|
#define TR_V2 "V2"
|
||||||
|
|||||||
@@ -422,6 +422,8 @@
|
|||||||
#define TR_OPTREX_DISPLAY "Afficheur Optrex"
|
#define TR_OPTREX_DISPLAY "Afficheur Optrex"
|
||||||
#define TR_BRIGHTNESS "Luminosit\200"
|
#define TR_BRIGHTNESS "Luminosit\200"
|
||||||
#define TR_CPU_TEMP "Temp. CPU\010>"
|
#define TR_CPU_TEMP "Temp. CPU\010>"
|
||||||
|
#define TR_CAPAWARNING "Capacity Warning"
|
||||||
|
#define TR_TEMPWARNING "Alarme temp"
|
||||||
#define TR_FUNC "Fonc"
|
#define TR_FUNC "Fonc"
|
||||||
#define TR_V1 "V1"
|
#define TR_V1 "V1"
|
||||||
#define TR_V2 "V2"
|
#define TR_V2 "V2"
|
||||||
|
|||||||
@@ -423,6 +423,8 @@
|
|||||||
#define TR_OPTREX_DISPLAY "Display Optrex"
|
#define TR_OPTREX_DISPLAY "Display Optrex"
|
||||||
#define TR_BRIGHTNESS "Luminosita'"
|
#define TR_BRIGHTNESS "Luminosita'"
|
||||||
#define TR_CPU_TEMP "Temp CPU \010>"
|
#define TR_CPU_TEMP "Temp CPU \010>"
|
||||||
|
#define TR_CAPAWARNING "Capacity Warning"
|
||||||
|
#define TR_TEMPWARNING "Temp Warning"
|
||||||
#define TR_FUNC "Funz"
|
#define TR_FUNC "Funz"
|
||||||
#define TR_V1 "V1"
|
#define TR_V1 "V1"
|
||||||
#define TR_V2 "V2"
|
#define TR_V2 "V2"
|
||||||
|
|||||||
@@ -421,6 +421,8 @@
|
|||||||
#define TR_OPTREX_DISPLAY "Optrex Display"
|
#define TR_OPTREX_DISPLAY "Optrex Display"
|
||||||
#define TR_BRIGHTNESS "Brightness"
|
#define TR_BRIGHTNESS "Brightness"
|
||||||
#define TR_CPU_TEMP "CPU temp.\010>"
|
#define TR_CPU_TEMP "CPU temp.\010>"
|
||||||
|
#define TR_CAPAWARNING "Capacity Warning"
|
||||||
|
#define TR_TEMPWARNING "Temp Warning"
|
||||||
#define TR_FUNC "Func"
|
#define TR_FUNC "Func"
|
||||||
#define TR_V1 "V1"
|
#define TR_V1 "V1"
|
||||||
#define TR_V2 "V2"
|
#define TR_V2 "V2"
|
||||||
|
|||||||
Reference in New Issue
Block a user