Update to latest libopenui
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ template <int N>
|
||||
class DMAFifo
|
||||
{
|
||||
public:
|
||||
DMAFifo(DMA_Stream_TypeDef * stream):
|
||||
explicit DMAFifo(DMA_Stream_TypeDef * stream):
|
||||
stream(stream),
|
||||
ridx(0)
|
||||
{
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@
|
||||
#define _RTOS_H_
|
||||
|
||||
#include "definitions.h"
|
||||
#include "board.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C++" {
|
||||
@@ -155,7 +156,7 @@ template<int SIZE>
|
||||
}
|
||||
#endif
|
||||
|
||||
#define RTOS_MS_PER_TICK ((CFG_CPU_FREQ / CFG_SYSTICK_FREQ) / (CFG_CPU_FREQ / 1000)) // RTOS timer tick length in ms (currently 2)
|
||||
#define RTOS_MS_PER_TICK ((CPU_FREQ / CFG_SYSTICK_FREQ) / (CPU_FREQ / 1000)) // RTOS timer tick length in ms (currently 2)
|
||||
|
||||
typedef OS_TID RTOS_TASK_HANDLE;
|
||||
typedef OS_MutexID RTOS_MUTEX_HANDLE;
|
||||
|
||||
+6
-6
@@ -148,11 +148,11 @@ OpenTxSim::~OpenTxSim()
|
||||
{
|
||||
TRACE("OpenTxSim::~OpenTxSim()");
|
||||
|
||||
StopSimu();
|
||||
StopAudioThread();
|
||||
simuStop();
|
||||
stopAudioThread();
|
||||
|
||||
#if defined(EEPROM)
|
||||
StopEepromThread();
|
||||
stopEepromThread();
|
||||
#endif
|
||||
|
||||
delete bmp;
|
||||
@@ -581,10 +581,10 @@ int main(int argc, char ** argv)
|
||||
simuInit();
|
||||
|
||||
#if defined(EEPROM)
|
||||
StartEepromThread(argc >= 2 ? argv[1] : "eeprom.bin");
|
||||
startEepromThread(argc >= 2 ? argv[1] : "eeprom.bin");
|
||||
#endif
|
||||
StartAudioThread();
|
||||
StartSimu(false, argc >= 3 ? argv[2] : 0, argc >= 4 ? argv[3] : 0);
|
||||
startAudioThread();
|
||||
simuStart(false, argc >= 3 ? argv[2] : 0, argc >= 4 ? argv[3] : 0);
|
||||
|
||||
return application.run();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
../common/arm/stm32/rtc_driver.cpp
|
||||
${AUX_SERIAL_DRIVER}
|
||||
../common/arm/stm32/delays.cpp
|
||||
../common/arm/stm32/delays_driver.cpp
|
||||
../common/arm/stm32/usb_bsp.c
|
||||
../common/arm/stm32/usbd_desc.c
|
||||
../common/arm/stm32/usbd_usr.cpp
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
#include "stm32f2xx_flash.h"
|
||||
#include "stm32f2xx_dbgmcu.h"
|
||||
#include "misc.h"
|
||||
#include "dwt.h" // the old ST library that we use does not define DWT register for STM32F2xx
|
||||
#endif
|
||||
|
||||
#if __clang__
|
||||
@@ -127,13 +128,28 @@ static inline bool isVBatBridgeEnabled()
|
||||
}
|
||||
|
||||
// Delays driver
|
||||
#define SYSTEM_TICKS_1MS ((CPU_FREQ + 500) / 1000)
|
||||
#define SYSTEM_TICKS_1US ((CPU_FREQ + 500000) / 1000000)
|
||||
#define SYSTEM_TICKS_01US ((CPU_FREQ + 5000000) / 10000000)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void delaysInit(void);
|
||||
void delay_01us(uint16_t nb);
|
||||
void delay_us(uint16_t nb);
|
||||
void delay_ms(uint32_t ms);
|
||||
|
||||
inline uint32_t ticksNow()
|
||||
{
|
||||
#if defined(SIMU)
|
||||
return 0;
|
||||
#else
|
||||
return DWT->CYCCNT;
|
||||
#endif
|
||||
}
|
||||
|
||||
void delaysInit();
|
||||
void delay_01us(uint32_t count);
|
||||
void delay_us(uint32_t count);
|
||||
void delay_ms(uint32_t count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -78,7 +78,7 @@ set(BOOTLOADER_SRC
|
||||
../../../../../targets/${TARGET_DIR}/bootloader/boot_menu.cpp
|
||||
../usbd_usr.cpp
|
||||
../usbd_storage_msd.cpp
|
||||
../delays.cpp
|
||||
../delays_driver.cpp
|
||||
../usbd_desc.c
|
||||
../usb_bsp.c
|
||||
../usb_driver.cpp
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <OsConfig.h>
|
||||
#include "board.h"
|
||||
#if defined(STM32F2)
|
||||
#include "dwt.h" // the old ST library that we use does not define DWT register for STM32F2xx
|
||||
#endif
|
||||
|
||||
#define SYSTEM_TICKS_1US ((CFG_CPU_FREQ + 500000) / 1000000) // number of system ticks in 1us
|
||||
#define SYSTEM_TICKS_01US ((CFG_CPU_FREQ + 5000000) / 10000000) // number of system ticks in 0.1us (rounding needed for sys frequencies that are not multiple of 10MHz)
|
||||
|
||||
void delaysInit(void)
|
||||
{
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
|
||||
DWT->CYCCNT = 0;
|
||||
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
|
||||
}
|
||||
|
||||
void delay_01us(uint16_t nb)
|
||||
{
|
||||
volatile uint32_t dwtStart = DWT->CYCCNT;
|
||||
volatile uint32_t dwtTotal = (SYSTEM_TICKS_01US * nb) - 10;
|
||||
while ((DWT->CYCCNT - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_us(uint16_t nb)
|
||||
{
|
||||
volatile uint32_t dwtStart = DWT->CYCCNT;
|
||||
volatile uint32_t dwtTotal = (SYSTEM_TICKS_1US * nb) - 10;
|
||||
while ((DWT->CYCCNT - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_ms(uint32_t ms)
|
||||
{
|
||||
while (ms--) {
|
||||
delay_us(1000);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
|
||||
void delaysInit()
|
||||
{
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
|
||||
DWT->CYCCNT = 0;
|
||||
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
|
||||
}
|
||||
|
||||
void delay_01us(uint32_t count)
|
||||
{
|
||||
volatile uint32_t dwtStart = ticksNow();
|
||||
volatile uint32_t dwtTotal = (SYSTEM_TICKS_01US * count) - 10;
|
||||
while ((ticksNow() - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_us(uint32_t count)
|
||||
{
|
||||
volatile uint32_t dwtStart = ticksNow();
|
||||
volatile uint32_t dwtTotal = (SYSTEM_TICKS_1US * count) - 10;
|
||||
while ((ticksNow() - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_1ms()
|
||||
{
|
||||
volatile uint32_t dwtStart = ticksNow();
|
||||
volatile uint32_t dwtTotal = SYSTEM_TICKS_1MS - 10;
|
||||
while ((ticksNow() - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_ms(uint32_t count)
|
||||
{
|
||||
while (count--) {
|
||||
delay_1ms();
|
||||
}
|
||||
}
|
||||
@@ -123,15 +123,6 @@ uint32_t sdMounted();
|
||||
#define SD_CARD_PRESENT() true
|
||||
#endif
|
||||
|
||||
#if defined(DISK_CACHE)
|
||||
#include "FatFs/diskio.h"
|
||||
DRESULT __disk_read(BYTE drv, BYTE * buff, DWORD sector, UINT count);
|
||||
DRESULT __disk_write(BYTE drv, const BYTE * buff, DWORD sector, UINT count);
|
||||
#else
|
||||
#define __disk_read disk_read
|
||||
#define __disk_write disk_write
|
||||
#endif
|
||||
|
||||
// Flash Write driver
|
||||
#define FLASH_PAGESIZE 256
|
||||
void unlockFlash();
|
||||
@@ -658,13 +649,13 @@ void bluetoothWriteWakeup();
|
||||
uint8_t bluetoothIsWriting();
|
||||
void bluetoothDisable();
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#include "fifo.h"
|
||||
#include "dmafifo.h"
|
||||
extern DMAFifo<512> telemetryFifo;
|
||||
typedef DMAFifo<32> AuxSerialRxFifo;
|
||||
extern AuxSerialRxFifo auxSerialRxFifo;
|
||||
extern volatile uint32_t externalModulePort;
|
||||
#endif
|
||||
//#if defined(__cplusplus)
|
||||
//#include "fifo.h"
|
||||
//#include "dmafifo.h"
|
||||
//extern DMAFifo<512> telemetryFifo;
|
||||
//typedef DMAFifo<32> AuxSerialRxFifo;
|
||||
//extern AuxSerialRxFifo auxSerialRxFifo;
|
||||
//extern volatile uint32_t externalModulePort;
|
||||
//#endif
|
||||
|
||||
#endif // _BOARD_H_
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef _HAL_H_
|
||||
#define _HAL_H_
|
||||
|
||||
#define CPU_FREQ 168000000
|
||||
|
||||
// Keys
|
||||
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOG | RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOI | RCC_AHB1Periph_GPIOJ)
|
||||
#if defined(PCBX12S)
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
#include "../definitions.h"
|
||||
#include "../opentx_constants.h"
|
||||
#include "board_common.h"
|
||||
#include "hal.h"
|
||||
#include "board_common.h"
|
||||
|
||||
#if !defined(LUA_EXPORT_GENERATION)
|
||||
#include "stm32f4xx_sdio.h"
|
||||
@@ -71,18 +71,6 @@ void boardOff();
|
||||
void init2MhzTimer();
|
||||
void init5msTimer();
|
||||
|
||||
// Delays driver
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void delaysInit();
|
||||
void delay_01us(uint16_t nb);
|
||||
void delay_us(uint16_t nb);
|
||||
void delay_ms(uint32_t ms);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// CPU Unique ID
|
||||
#define LEN_CPU_UID (3*8+2)
|
||||
void getCPUUniqueID(char * s);
|
||||
@@ -110,15 +98,6 @@ uint32_t sdMounted();
|
||||
#define SD_CARD_PRESENT() true
|
||||
#endif
|
||||
|
||||
#if defined(DISK_CACHE)
|
||||
#include "diskio.h"
|
||||
DRESULT __disk_read(BYTE drv, BYTE * buff, DWORD sector, UINT count);
|
||||
DRESULT __disk_write(BYTE drv, const BYTE * buff, DWORD sector, UINT count);
|
||||
#else
|
||||
#define __disk_read disk_read
|
||||
#define __disk_write disk_write
|
||||
#endif
|
||||
|
||||
// Flash Write driver
|
||||
#define FLASH_PAGESIZE 256
|
||||
void unlockFlash();
|
||||
@@ -373,7 +352,6 @@ void adcInit();
|
||||
void adcRead();
|
||||
uint16_t getAnalogValue(uint8_t index);
|
||||
uint16_t getBatteryVoltage(); // returns current battery voltage in 10mV steps
|
||||
uint16_t getBattery2Voltage(); // returns current battery voltage in 10mV steps
|
||||
|
||||
#define BATTERY_WARN 36 // 3.6V
|
||||
#define BATTERY_MIN 35 // 3.5V
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef _HAL_H_
|
||||
#define _HAL_H_
|
||||
|
||||
#define CPU_FREQ 168000000
|
||||
|
||||
/* Timers Allocation:
|
||||
* TIM1 = Haptic
|
||||
* TIM4 = Trainer
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "audio_driver.h"
|
||||
#include "../opentx_constants.h"
|
||||
|
||||
#define CPU_FREQ 36000000
|
||||
|
||||
extern uint16_t ResetReason;
|
||||
|
||||
#define BOOTLOADER_SIZE 0x8000
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <inttypes.h>
|
||||
#include "definitions.h"
|
||||
#include "opentx_constants.h"
|
||||
#include "board_common.h"
|
||||
#include "hal.h"
|
||||
#include "board_common.h"
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
// Rotary Encoder driver
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
#ifndef _HAL_H_
|
||||
#define _HAL_H_
|
||||
|
||||
#if defined(STM32F4)
|
||||
#define CPU_FREQ 168000000
|
||||
#else
|
||||
#define CPU_FREQ 120000000
|
||||
#endif
|
||||
|
||||
// Keys
|
||||
#if defined(PCBX9E)
|
||||
#define KEYS_GPIO_REG_MENU GPIOD->IDR
|
||||
|
||||
@@ -159,7 +159,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
simuInit();
|
||||
StartEepromThread(nullptr);
|
||||
startEepromThread(nullptr);
|
||||
#if defined(EEPROM_SIZE)
|
||||
eeprom = (uint8_t *)malloc(EEPROM_SIZE);
|
||||
#endif
|
||||
|
||||
Vendored
-11
@@ -71,17 +71,6 @@ Idle task stack size(word).
|
||||
#define CFG_IDLE_STACK_SIZE (25)
|
||||
#endif
|
||||
|
||||
/*!<
|
||||
System frequency (Hz).
|
||||
*/
|
||||
#if defined(STM32F4)
|
||||
#define CFG_CPU_FREQ (168000000)
|
||||
#elif defined(STM32)
|
||||
#define CFG_CPU_FREQ (120000000)
|
||||
#else
|
||||
#define CFG_CPU_FREQ (36000000) // TODO check if really correct for sky9x?
|
||||
#endif
|
||||
|
||||
/*!<
|
||||
systick frequency (Hz).
|
||||
*/
|
||||
|
||||
+2
-1
@@ -42,10 +42,11 @@
|
||||
#ifndef _CPU_H
|
||||
#define _CPU_H
|
||||
|
||||
#include "board.h"
|
||||
|
||||
#define NVIC_ST_CTRL (*((volatile U32 *)0xE000E010))
|
||||
#define NVIC_ST_RELOAD (*((volatile U32 *)0xE000E014))
|
||||
#define RELOAD_VAL ((U32)(( (U32)CFG_CPU_FREQ) / (U32)CFG_SYSTICK_FREQ) -1)
|
||||
#define RELOAD_VAL ((U32)(( (U32)CPU_FREQ) / (U32)CFG_SYSTICK_FREQ) -1)
|
||||
|
||||
/*!< Initial System tick. */
|
||||
#define InitSysTick() NVIC_ST_RELOAD = RELOAD_VAL; \
|
||||
|
||||
Vendored
+10
-2
@@ -5,12 +5,12 @@
|
||||
#ifndef _DISKIO_DEFINED
|
||||
#define _DISKIO_DEFINED
|
||||
|
||||
#include "ff.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ff.h"
|
||||
|
||||
/* Status of Disk Functions */
|
||||
typedef BYTE DSTATUS;
|
||||
|
||||
@@ -34,6 +34,14 @@ DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
|
||||
#if defined(DISK_CACHE)
|
||||
// #include "FatFs/diskio.h"
|
||||
DRESULT __disk_read(BYTE drv, BYTE * buff, DWORD sector, UINT count);
|
||||
DRESULT __disk_write(BYTE drv, const BYTE * buff, DWORD sector, UINT count);
|
||||
#else
|
||||
#define __disk_read disk_read
|
||||
#define __disk_write disk_write
|
||||
#endif
|
||||
|
||||
/* Disk Status Bits (DSTATUS) */
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -22,12 +22,12 @@
|
||||
#ifndef FF_DEFINED
|
||||
#define FF_DEFINED 86604 /* Revision ID */
|
||||
|
||||
#include "ffconf.h" /* FatFs configuration options */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ffconf.h" /* FatFs configuration options */
|
||||
|
||||
#if FF_DEFINED != FFCONF_DEF
|
||||
#error Wrong configuration file (ffconf.h).
|
||||
#endif
|
||||
|
||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 05cd2ae9dc...d0634734b4
Reference in New Issue
Block a user