Update to latest libopenui
This commit is contained in:
@@ -126,9 +126,9 @@ void OpenTxSimulator::start(const char * filename, bool tests)
|
||||
|
||||
QMutexLocker lckr(&m_mtxSimuMain);
|
||||
QMutexLocker slckr(&m_mtxSettings);
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread(volumeGain);
|
||||
StartSimu(tests, simuSdDirectory.toLatin1().constData(), simuSettingsDirectory.toLatin1().constData());
|
||||
startEepromThread(filename);
|
||||
startAudioThread(volumeGain);
|
||||
simuStart(tests, simuSdDirectory.toLatin1().constData(), simuSettingsDirectory.toLatin1().constData());
|
||||
|
||||
emit started();
|
||||
QTimer::singleShot(0, this, SLOT(run())); // old style for Qt < 5.4
|
||||
@@ -143,9 +143,9 @@ void OpenTxSimulator::stop()
|
||||
setStopRequested(true);
|
||||
|
||||
QMutexLocker lckr(&m_mtxSimuMain);
|
||||
StopSimu();
|
||||
StopAudioThread();
|
||||
StopEepromThread();
|
||||
simuStop();
|
||||
stopAudioThread();
|
||||
stopEepromThread();
|
||||
|
||||
emit stopped();
|
||||
}
|
||||
|
||||
@@ -52,6 +52,25 @@ USART_TypeDef Usart0, Usart1, Usart2, Usart3, Usart4;
|
||||
SysTick_Type systick;
|
||||
ADC_Common_TypeDef adc;
|
||||
RTC_TypeDef rtc;
|
||||
void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) { }
|
||||
void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct) { }
|
||||
void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState) { }
|
||||
void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState) { }
|
||||
FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG) { return RESET; }
|
||||
uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx) { return 0; }
|
||||
void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data) { }
|
||||
void DMA_DeInit(DMA_Stream_TypeDef* DMAy_Streamx) { }
|
||||
void DMA_Init(DMA_Stream_TypeDef* DMAy_Streamx, DMA_InitTypeDef* DMA_InitStruct) { }
|
||||
void DMA_ITConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT, FunctionalState NewState) { }
|
||||
void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct) { }
|
||||
void DMA_Cmd(DMA_Stream_TypeDef* DMAy_Streamx, FunctionalState NewState) { }
|
||||
void lcdCopy(void * dest, void * src);
|
||||
FlagStatus DMA_GetFlagStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_FLAG) { return RESET; }
|
||||
ITStatus DMA_GetITStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT) { return RESET; }
|
||||
void DMA_ClearITPendingBit(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT) { }
|
||||
void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState) { }
|
||||
void UART3_Configure(uint32_t baudrate, uint32_t masterClock) { }
|
||||
void NVIC_Init(NVIC_InitTypeDef * NVIC_InitStruct) { }
|
||||
#else
|
||||
Pio Pioa, Piob, Pioc;
|
||||
Pmc pmc;
|
||||
@@ -175,7 +194,7 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
switchesStates[swtch] = state;
|
||||
}
|
||||
|
||||
void StartSimu(bool tests, const char * sdPath, const char * settingsPath)
|
||||
void simuStart(bool tests, const char * sdPath, const char * settingsPath)
|
||||
{
|
||||
if (simu_running)
|
||||
return;
|
||||
@@ -224,7 +243,7 @@ void StartSimu(bool tests, const char * sdPath, const char * settingsPath)
|
||||
#endif
|
||||
}
|
||||
|
||||
void StopSimu()
|
||||
void simuStop()
|
||||
{
|
||||
if (!simu_running)
|
||||
return;
|
||||
@@ -379,12 +398,12 @@ void * audioThread(void *)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void StartAudioThread(int volumeGain)
|
||||
void startAudioThread(int volumeGain)
|
||||
{
|
||||
simuAudio.leftoverLen = 0;
|
||||
simuAudio.threadRunning = true;
|
||||
simuAudio.volumeGain = volumeGain;
|
||||
TRACE_SIMPGMSPACE("StartAudioThread(%d)", volumeGain);
|
||||
TRACE_SIMPGMSPACE("startAudioThread(%d)", volumeGain);
|
||||
setScaledVolume(VOLUME_LEVEL_DEF);
|
||||
|
||||
pthread_attr_t attr;
|
||||
@@ -398,7 +417,7 @@ void StartAudioThread(int volumeGain)
|
||||
#endif
|
||||
}
|
||||
|
||||
void StopAudioThread()
|
||||
void stopAudioThread()
|
||||
{
|
||||
simuAudio.threadRunning = false;
|
||||
pthread_join(simuAudio.threadPid, nullptr);
|
||||
|
||||
@@ -240,25 +240,27 @@ extern char * main_thread_error;
|
||||
inline void getADC() { }
|
||||
|
||||
uint64_t simuTimerMicros(void);
|
||||
|
||||
void simuInit();
|
||||
void StartSimu(bool tests=true, const char * sdPath = 0, const char * settingsPath = 0);
|
||||
void StopSimu();
|
||||
bool simuIsRunning();
|
||||
uint8_t simuSleep(uint32_t ms); // returns true if thread shutdown requested
|
||||
|
||||
void simuSetKey(uint8_t key, bool state);
|
||||
void simuSetTrim(uint8_t trim, bool state);
|
||||
void simuSetSwitch(uint8_t swtch, int8_t state);
|
||||
|
||||
void StartEepromThread(const char *filename="eeprom.bin");
|
||||
void StopEepromThread();
|
||||
#if defined(__cplusplus)
|
||||
void simuInit();
|
||||
void simuStart(bool tests = true, const char * sdPath = nullptr, const char * settingsPath = nullptr);
|
||||
void simuStop();
|
||||
bool simuIsRunning();
|
||||
void startEepromThread(const char * filename = "eeprom.bin");
|
||||
void stopEepromThread();
|
||||
|
||||
#if defined(SIMU_AUDIO)
|
||||
void StartAudioThread(int volumeGain = 10);
|
||||
void StopAudioThread(void);
|
||||
void startAudioThread(int volumeGain = 10);
|
||||
void stopAudioThread(void);
|
||||
#else
|
||||
#define StartAudioThread(dummy)
|
||||
#define StopAudioThread()
|
||||
#define startAudioThread(dummy)
|
||||
#define stopAudioThread()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void simuMain();
|
||||
@@ -269,7 +271,6 @@ void simuMain();
|
||||
#define USART_ClearFlag(...)
|
||||
|
||||
#if defined(STM32)
|
||||
inline void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) { }
|
||||
#define TIM_DeInit(...)
|
||||
#define TIM_SetCompare2(...)
|
||||
#define TIM_ClearFlag(...)
|
||||
@@ -280,27 +281,10 @@ inline void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) {
|
||||
#define GPIO_ReadInputDataBit(GPIOx, pin) (GPIOx->BSRRL & pin)
|
||||
#define RCC_AHB1PeriphClockCmd(...)
|
||||
#define RCC_APB2PeriphClockCmd(...)
|
||||
inline void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct) { }
|
||||
inline void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState) { }
|
||||
inline void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState) { }
|
||||
inline FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG) { return RESET; }
|
||||
inline uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx) { return 0; }
|
||||
inline void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data) { }
|
||||
inline void DMA_DeInit(DMA_Stream_TypeDef* DMAy_Streamx) { }
|
||||
inline void DMA_Init(DMA_Stream_TypeDef* DMAy_Streamx, DMA_InitTypeDef* DMA_InitStruct) { }
|
||||
inline void DMA_ITConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT, FunctionalState NewState) { }
|
||||
inline void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct) { }
|
||||
inline void DMA_Cmd(DMA_Stream_TypeDef* DMAy_Streamx, FunctionalState NewState) { }
|
||||
void lcdCopy(void * dest, void * src);
|
||||
inline FlagStatus DMA_GetFlagStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_FLAG) { return RESET; }
|
||||
inline ITStatus DMA_GetITStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT) { return RESET; }
|
||||
inline void DMA_ClearITPendingBit(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT) { }
|
||||
inline void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState) { }
|
||||
inline void UART3_Configure(uint32_t baudrate, uint32_t masterClock) { }
|
||||
inline void NVIC_Init(NVIC_InitTypeDef *) { }
|
||||
#endif
|
||||
|
||||
inline void delay_01us(int dummy) { }
|
||||
// inline void delay_01us(uint32_t dummy) { }
|
||||
|
||||
#define configure_pins(...)
|
||||
|
||||
#if defined(SDCARD) && !defined(SKIP_FATFS_DECLARATION) && !defined(SIMU_DISKIO)
|
||||
|
||||
@@ -139,7 +139,7 @@ void eepromWriteBlock(uint8_t * buffer, size_t address, size_t size)
|
||||
|
||||
pthread_t eeprom_thread_pid;
|
||||
|
||||
void StartEepromThread(const char * filename)
|
||||
void startEepromThread(const char * filename)
|
||||
{
|
||||
eepromFile = filename;
|
||||
if (eepromFile) {
|
||||
@@ -160,7 +160,7 @@ void StartEepromThread(const char * filename)
|
||||
RTOS_CREATE_TASK(eeprom_thread_pid, eeprom_thread_function, "eeprom");
|
||||
}
|
||||
|
||||
void StopEepromThread()
|
||||
void stopEepromThread()
|
||||
{
|
||||
eeprom_thread_running = false;
|
||||
sem_post(eeprom_write_sem);
|
||||
|
||||
Reference in New Issue
Block a user