Bsongis/adc rtc temperature (#6537)

RTC voltage + CPU temperature + RTC voltage alarm (thanks @schwabe)
This commit is contained in:
Bertrand Songis
2019-07-03 07:58:32 +02:00
committed by GitHub
parent 6ba4b84a45
commit 3a0960c1e3
49 changed files with 568 additions and 447 deletions
+9 -1
View File
@@ -25,7 +25,7 @@
#define MAX_LOGICAL_SWITCHES NUM_CSW
#endif
#define GET_SWITCH_BOOL(sw__) getSwitch((sw__), 0);
#define GET_SWITCH_BOOL(sw__) getSwitch((sw__), 0);
#define OTXS_DBG qDebug() << "(" << simuTimerMicros() << "us)"
@@ -93,6 +93,7 @@ void OpenTxSimulator::init()
{
if (isRunning())
return;
OTXS_DBG;
if (!m_timer10ms) {
@@ -109,6 +110,13 @@ void OpenTxSimulator::init()
QMutexLocker lckr(&m_mtxSimuMain);
memset(g_anas, 0, sizeof(g_anas));
#if defined(PCBTARANIS)
g_anas[TX_INTREF] = 826; // 3V VDD
g_anas[TX_RTC_VOLTAGE] = 800; // 2,34V
g_anas[TX_TEMPERATURE] = 520;
#endif
simuInit();
}
+1
View File
@@ -50,6 +50,7 @@ DMA_Stream_TypeDef dma1_stream1, dma1_stream2, dma1_stream3, dma1_stream4, dma1_
DMA_TypeDef dma2;
USART_TypeDef Usart0, Usart1, Usart2, Usart3, Usart4;
SysTick_Type systick;
ADC_Common_TypeDef adc;
#else
Pio Pioa, Piob, Pioc;
Pmc pmc;
+3 -5
View File
@@ -87,6 +87,7 @@ extern RCC_TypeDef rcc;
extern DMA_Stream_TypeDef dma1_stream0, dma1_stream1, dma1_stream2, dma1_stream3, dma1_stream4, dma1_stream5, dma1_stream6, dma1_stream7, dma2_stream1, dma2_stream2, dma2_stream5, dma2_stream6, dma2_stream7;
extern DMA_TypeDef dma2;
extern SysTick_Type systick;
extern ADC_Common_TypeDef adc;
#undef SysTick
#define SysTick (&systick)
#undef GPIOA
@@ -165,6 +166,8 @@ extern SysTick_Type systick;
#define DMA2_Stream7 (&dma2_stream7)
#undef DMA2
#define DMA2 (&dma2)
#undef ADC
#define ADC (&adc)
#elif defined(PCBSKY9X)
extern Pmc pmc;
#undef PMC
@@ -208,12 +211,7 @@ extern Pwm pwm;
#define PWM (&pwm)
#endif
#if defined(EEPROM_SIZE)
extern uint8_t eeprom[EEPROM_SIZE];
#else
extern uint8_t * eeprom;
#endif
extern void startPdcUsartReceive() ;
extern uint32_t txPdcUsart( uint8_t *buffer, uint32_t size );
extern uint32_t txPdcPending();
-8
View File
@@ -22,20 +22,12 @@
const char * eepromFile = nullptr;
FILE * fp = nullptr;
uint32_t eeprom_pointer;
uint8_t * eeprom_buffer_data;
volatile int32_t eeprom_buffer_size;
bool eeprom_read_operation;
bool eeprom_thread_running = false;
#if defined(EEPROM_SIZE)
uint8_t eeprom[EEPROM_SIZE];
#else
uint8_t * eeprom = nullptr;
#endif
sem_t * eeprom_write_sem;
void eepromReadBlock (uint8_t * buffer, size_t address, size_t size)