mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Cosmetics
This commit is contained in:
parent
dd44da14bc
commit
0ad015f3e7
32 changed files with 227 additions and 183 deletions
|
@ -125,7 +125,7 @@ bool RleFile::searchFat()
|
|||
uint32_t bestFatIndex = 0;
|
||||
for (int i=0; i<EEPROM_ZONE_SIZE/EEPROM_FAT_SIZE; i++) {
|
||||
EepromHeader * header = (EepromHeader *)(eeprom+i*EEPROM_FAT_SIZE);
|
||||
if (header->mark == EEPROM_MARK && (int)header->index >= bestFatIndex) {
|
||||
if (header->mark == EEPROM_MARK && header->index >= bestFatIndex) {
|
||||
eepromFatHeader = header;
|
||||
bestFatIndex = header->index;
|
||||
}
|
||||
|
|
|
@ -552,9 +552,9 @@ int cliDisplay(const char ** argv)
|
|||
serialPrint(reg & 0x02 ? "Thermal sensor bad" : "Thermal sensor ok");
|
||||
serialPrint(reg & 0x04 ? "Power ok" : "Power bad");
|
||||
serialPrint(reg & 0x08 ? "Connected to charger" : "Not connected to charger");
|
||||
const char * CHARGE_STATUS[] = { "Not Charging", "Precharge", "Fast Charging", "Charge done" };
|
||||
static const char * const CHARGE_STATUS[] = { "Not Charging", "Precharge", "Fast Charging", "Charge done" };
|
||||
serialPrint(CHARGE_STATUS[(reg & 0x30) >> 4]);
|
||||
const char * INPUT_STATUS[] = { "Unknown input", "USB host input", "USB adapter port input", "OTG input" };
|
||||
static const char * const INPUT_STATUS[] = { "Unknown input", "USB host input", "USB adapter port input", "OTG input" };
|
||||
serialPrint(INPUT_STATUS[(reg & 0xC0) >> 6]);
|
||||
}
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
#define MAX_SCRIPTS 7
|
||||
#define MAX_INPUTS 32
|
||||
#define NUM_TRAINER 16
|
||||
#define NUM_POTS 3
|
||||
#define NUM_POTS 4
|
||||
#define NUM_XPOTS 0
|
||||
#define MAX_SENSORS 32
|
||||
#elif defined(PCBTARANIS)
|
||||
|
|
|
@ -557,6 +557,7 @@ PACK(struct FrSkyChannelData {
|
|||
uint8_t multiplier; // 0=no multiplier, 1=*2 multiplier
|
||||
});
|
||||
|
||||
// TODO remove this also on Taranis
|
||||
PACK(struct FrSkyTelemetryData {
|
||||
uint8_t voltsSource;
|
||||
uint8_t altitudeSource;
|
||||
|
@ -965,7 +966,7 @@ PACK(struct TrainerData {
|
|||
#define EXTRA_GENERAL_FIELDS
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#if defined(PCBHORUS)
|
||||
#include "gui/horus/theme.h"
|
||||
#define THEME_DATA \
|
||||
NOBACKUP(char themeName[8]); \
|
||||
|
@ -1085,6 +1086,8 @@ static inline void check_struct()
|
|||
CHKSIZE(ModelData, 6507);
|
||||
#endif
|
||||
|
||||
#elif defined(PCBFLAMENCO)
|
||||
|
||||
#elif defined(PCBHORUS)
|
||||
CHKSIZE(MixData, 20);
|
||||
CHKSIZE(ExpoData, 17);
|
||||
|
|
|
@ -56,6 +56,7 @@ uint8_t serial2TracesEnabled();
|
|||
|
||||
#define TRACE_PING(...) do { debugPrintf(__VA_ARGS__); } while(0)
|
||||
#define TRACE(...) do { debugPrintf(__VA_ARGS__); debugPrintf("\r\n"); } while(0)
|
||||
#define TRACE_WP(...) debugPrintf(__VA_ARGS__)
|
||||
#define DUMP(data, size) dump(data, size)
|
||||
#define TRACE_DEBUG(...) debugPrintf("-D- " __VA_ARGS__)
|
||||
#define TRACE_DEBUG_WP(...) debugPrintf(__VA_ARGS__)
|
||||
|
|
|
@ -26,8 +26,10 @@
|
|||
extern const uint16_t * const fontspecsTable[16];
|
||||
extern const uint8_t * const fontsTable[16];
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
extern BitmapBuffer * fontCache[2];
|
||||
void loadFontCache();
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -288,7 +288,6 @@ getvalue_t getValue(mixsrc_t i)
|
|||
else if (i==MIXSRC_SA) return (switchState(SW_SA0) ? -1024 : (switchState(SW_SA1) ? 0 : 1024));
|
||||
else if (i==MIXSRC_SB) return (switchState(SW_SB0) ? -1024 : 1024);
|
||||
else if (i==MIXSRC_SC) return (switchState(SW_SC0) ? -1024 : (switchState(SW_SC1) ? 0 : 1024));
|
||||
// else if (i==MIXSRC_SD) return (switchState(SW_SD0) ? -1024 : 1024);
|
||||
else if (i==MIXSRC_SE) return (switchState(SW_SE0) ? -1024 : 1024);
|
||||
else if (i==MIXSRC_SF) return (switchState(SW_SF0) ? -1024 : (switchState(SW_SF1) ? 0 : 1024));
|
||||
#elif defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
|
||||
#define ALTERNATE_VIEW 0x10
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#if defined(PCBHORUS)
|
||||
#include "layout.h"
|
||||
#include "theme.h"
|
||||
#include "topbar.h"
|
||||
|
|
|
@ -471,7 +471,7 @@ void modelDefault(uint8_t id)
|
|||
g_model.header.name[6] = '\033' + id%10;
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#if defined(PCBHORUS)
|
||||
extern const LayoutFactory * defaultLayout;
|
||||
delete customScreens[0];
|
||||
customScreens[0] = defaultLayout->create(&g_model.screenData[0].layoutData);
|
||||
|
@ -1913,6 +1913,8 @@ uint8_t calcStickScroll( uint8_t index )
|
|||
|
||||
void opentxStart()
|
||||
{
|
||||
TRACE("opentxStart()");
|
||||
|
||||
#if defined(SIMU)
|
||||
if (main_thread_running == 2)
|
||||
return;
|
||||
|
@ -1950,6 +1952,8 @@ void opentxStart()
|
|||
#if defined(CPUARM) || defined(CPUM2560)
|
||||
void opentxClose()
|
||||
{
|
||||
TRACE("opentxClose()");
|
||||
|
||||
#if defined(CPUARM)
|
||||
watchdogSetTimeout(2000/*20s*/);
|
||||
#endif
|
||||
|
@ -2494,7 +2498,7 @@ void opentxInit(OPENTX_INIT_ARGS)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#if defined(PCBHORUS)
|
||||
topbar = new Topbar(&g_model.topbarData);
|
||||
luaInit();
|
||||
#endif
|
||||
|
@ -2545,7 +2549,7 @@ void opentxInit(OPENTX_INIT_ARGS)
|
|||
btInit();
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#if defined(PCBHORUS)
|
||||
loadTheme();
|
||||
loadFontCache();
|
||||
#endif
|
||||
|
|
|
@ -272,14 +272,7 @@
|
|||
#define pgm_read_adr(x) *(x)
|
||||
#define cli()
|
||||
#define sei()
|
||||
extern void boardInit();
|
||||
#if defined(PCBTARANIS) or defined(PCBHORUS)
|
||||
extern void boardOff();
|
||||
#else
|
||||
#define boardOff() pwrOff();
|
||||
#endif
|
||||
#else
|
||||
#define boardOff() pwrOff();
|
||||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#include "pgmtypes.h"
|
||||
|
|
|
@ -97,7 +97,7 @@ void postModelLoad(bool newModel)
|
|||
referenceModelAudioFiles();
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#if defined(PCBHORUS)
|
||||
loadCustomScreens();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#define CS_LAST_VALUE_INIT -32768
|
||||
|
||||
#if defined(PCBFLAMENCO)
|
||||
#define SWITCH_WARNING_LIST_X 60
|
||||
#define SWITCH_WARNING_LIST_Y 4*FH+3
|
||||
#define SWITCH_WARNING_LIST_INTERVAL 20
|
||||
#elif defined(PCBHORUS)
|
||||
#define SWITCH_WARNING_LIST_X WARNING_LINE_X
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
|
||||
|
@ -77,9 +77,9 @@ void rotencPoll()
|
|||
#define ROTENC_DOWN() (0)
|
||||
#endif // ROTARY_ENCODER_NAVIGATION
|
||||
|
||||
#ifndef SIMU
|
||||
inline void boardInit()
|
||||
void boardInit()
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
// Set up I/O port data directions and initial states
|
||||
DDRA = 0xff; PORTA = 0x00; // LCD data
|
||||
DDRB = 0x81; PORTB = 0x7e; //pullups keys+nc
|
||||
|
@ -137,8 +137,8 @@ inline void boardInit()
|
|||
TIMSK |= (1<<OCIE0) | (1<<TOIE0); // Enable Output-Compare and Overflow interrrupts
|
||||
#endif
|
||||
#endif
|
||||
#endif // !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SIMU
|
||||
FORCEINLINE
|
||||
|
|
|
@ -62,6 +62,10 @@
|
|||
// - - - O i i i
|
||||
// SIM_CTL ID1 Haptic RF_POW RuddDR
|
||||
|
||||
// Board driver
|
||||
void boardInit(void);
|
||||
#define boardOff() pwrOff()
|
||||
|
||||
// Keys
|
||||
#define KEYS_GPIO_REG_MENU pinb
|
||||
#define KEYS_GPIO_PIN_MENU (1<<1)
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#ifndef SIMU
|
||||
inline void boardInit()
|
||||
void boardInit()
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
// Set up I/O port data directions and initial states
|
||||
DDRA = 0xff; PORTA = 0x00; // LCD data
|
||||
DDRB = 0b11000111; PORTB = 0b00111111; // 7:SPKR, 6:PPM_OUT, 5:TrainSW, 4:IDL2_SW, SDCARD[3:MISO 2:MOSI 1:SCK 0:CS]
|
||||
|
@ -88,7 +88,7 @@ inline void boardInit()
|
|||
#endif
|
||||
/***************************************************/
|
||||
|
||||
#if defined (VOICE)
|
||||
#if defined(VOICE)
|
||||
/*
|
||||
* SOMO set-up (V4 board only)
|
||||
*/
|
||||
|
@ -108,10 +108,10 @@ inline void boardInit()
|
|||
UCSR1B = (1<<RXEN1)|(0<<TXEN1)|(1<<UCSZ12);
|
||||
UCSR1B |= 1 << RXCIE1; //enable interrupt on rx
|
||||
#endif
|
||||
#endif // !defined(SIMU)
|
||||
}
|
||||
|
||||
#if ROTARY_ENCODERS > 2
|
||||
|
||||
uint8_t vpotToChange = 0;
|
||||
uint8_t vpot_mod_state = 0;
|
||||
|
||||
|
@ -146,7 +146,6 @@ ISR(USART1_RX_vect)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#endif // !SIMU
|
||||
|
||||
uint8_t pwrCheck()
|
||||
{
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
#include "../common_avr/board_avr.h"
|
||||
|
||||
// Board driver
|
||||
void boardInit(void);
|
||||
#define boardOff() pwrOff()
|
||||
|
||||
// Keys
|
||||
#define KEYS_GPIO_REG_MENU pinl
|
||||
#define KEYS_GPIO_PIN_MENU (1<<4)
|
||||
|
|
|
@ -108,7 +108,7 @@ void adcInit()
|
|||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = ADC_GPIO_PIN_MOUSE1 | ADC_GPIO_PIN_MOUSE2;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(ADC_GPIO_MOUSE, &GPIO_InitStructure);
|
||||
|
|
|
@ -101,7 +101,6 @@ void interrupt1ms()
|
|||
DEBUG_TIMER_STOP(debugTimerRotEnc);
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void TIM8_TRG_COM_TIM14_IRQHandler()
|
||||
{
|
||||
TIM14->SR &= ~TIM_SR_UIF;
|
||||
|
@ -111,6 +110,7 @@ extern "C" void TIM8_TRG_COM_TIM14_IRQHandler()
|
|||
|
||||
void boardInit()
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph |
|
||||
LED_RCC_AHB1Periph |
|
||||
LCD_RCC_AHB1Periph |
|
||||
|
@ -167,6 +167,7 @@ void boardInit()
|
|||
#endif
|
||||
|
||||
ledBlue();
|
||||
#endif
|
||||
}
|
||||
|
||||
void boardOff()
|
||||
|
@ -181,8 +182,6 @@ void boardOff()
|
|||
pwrOff();
|
||||
}
|
||||
|
||||
#endif // #if !defined(SIMU)
|
||||
|
||||
#if defined(USB_JOYSTICK) && !defined(SIMU)
|
||||
extern USB_OTG_CORE_HANDLE USB_OTG_dev;
|
||||
|
||||
|
@ -217,7 +216,7 @@ void usbJoystickUpdate(void)
|
|||
USBD_HID_SendReport (&USB_OTG_dev, HID_Buffer, HID_IN_PACKET);
|
||||
}
|
||||
|
||||
#endif //#if defined(USB_JOYSTICK) && defined(PCBTARANIS) && !defined(SIMU)
|
||||
#endif // #defined(USB_JOYSTICK) && !defined(SIMU)
|
||||
|
||||
|
||||
uint8_t currentTrainerMode = 0xff;
|
||||
|
|
|
@ -79,11 +79,17 @@ extern uint16_t sessionTimer;
|
|||
#define SLAVE_MODE() (g_model.trainerMode == TRAINER_MODE_SLAVE)
|
||||
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_GPIO_DETECT, TRAINER_GPIO_PIN_DETECT) == Bit_RESET)
|
||||
|
||||
// Board driver
|
||||
void boardInit(void);
|
||||
void boardOff(void);
|
||||
|
||||
// Delays driver
|
||||
#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);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -169,14 +175,9 @@ extern uint32_t rotencSpeed;
|
|||
void checkRotaryEncoder(void);
|
||||
|
||||
// WDT driver
|
||||
#if defined(SIMU)
|
||||
#define WAS_RESET_BY_WATCHDOG() (false)
|
||||
#define WAS_RESET_BY_SOFTWARE() (false)
|
||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (false)
|
||||
#else
|
||||
#define wdt_disable()
|
||||
void watchdogInit(unsigned int duration);
|
||||
#if defined(WATCHDOG_DISABLED)
|
||||
#if defined(WATCHDOG_DISABLED) || defined(SIMU)
|
||||
#define wdt_enable(x)
|
||||
#define wdt_reset()
|
||||
#else
|
||||
|
@ -186,7 +187,6 @@ void watchdogInit(unsigned int duration);
|
|||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
||||
#endif
|
||||
|
||||
// ADC driver
|
||||
enum Analogs {
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
#include "usb_bsp.h"
|
||||
|
||||
#include "board_horus.h"
|
||||
#include "usbd_conf.h"
|
||||
|
||||
|
|
|
@ -58,12 +58,7 @@
|
|||
#define USBD_SERIALNUMBER_FS_STRING "00000000001B"
|
||||
|
||||
|
||||
#if defined(BOOT)
|
||||
#define USBD_PID 0x5720
|
||||
#define USBD_PRODUCT_FS_STRING "FrSky Horus Bootloader"
|
||||
#define USBD_CONFIGURATION_FS_STRING "MSC Config"
|
||||
#define USBD_INTERFACE_FS_STRING "MSC Interface"
|
||||
#elif defined(USB_JOYSTICK)
|
||||
#if defined(USB_JOYSTICK)
|
||||
#define USBD_PID 0x5710
|
||||
#define USBD_PRODUCT_FS_STRING "FrSky Horus Joystick"
|
||||
#define USBD_CONFIGURATION_FS_STRING "HID Config"
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#ifndef SIMU
|
||||
inline void boardInit()
|
||||
void boardInit()
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
// Set up I/O port data directions and initial states (unused pin setting : input, pull-up on)
|
||||
DDRA = 0b11111111; PORTA = 0b00000000; // LCD data
|
||||
DDRB = 0b01110111; PORTB = 0b00101111; // 7:WTV20SDBusy, 6:PPM_OUT, 5:SimCTRL, 4:Buzzer, SDCARD[3:MISO 2:MOSI 1:SCK 0:CS]
|
||||
|
@ -72,8 +72,8 @@ inline void boardInit()
|
|||
EICRA = (1<<ISC30) | (1<<ISC20);
|
||||
EIFR = (3<<INTF2);
|
||||
EIMSK = (3<<INT4) | (3<<INT2); // enable the two rot. enc. ext. int. pairs.
|
||||
#endif // !defined(SIMU)
|
||||
}
|
||||
#endif // !SIMU
|
||||
|
||||
uint8_t pwrCheck()
|
||||
{
|
||||
|
|
|
@ -23,10 +23,13 @@
|
|||
|
||||
#include "../common_avr/board_avr.h"
|
||||
|
||||
|
||||
//Mods for futur use ? Beta tester love it
|
||||
//#define ROTENC_DIV2 // rotenc resolution/2
|
||||
|
||||
// Board driver
|
||||
void boardInit(void);
|
||||
#define boardOff() pwrOff()
|
||||
|
||||
// Keys
|
||||
#define KEYS_GPIO_REG_MENU pinl
|
||||
#define KEYS_GPIO_PIN_MENU (1<<4)
|
||||
|
|
|
@ -120,6 +120,10 @@ uint16_t getTmr2MHz()
|
|||
|
||||
void simuInit()
|
||||
{
|
||||
#if defined(CPUSTM32)
|
||||
RCC->CSR = 0;
|
||||
#endif
|
||||
|
||||
for (int i = 0; i <= 17; i++) {
|
||||
simuSetSwitch(i, 0);
|
||||
simuSetKey(i, false); // a little dirty, but setting keys that don't exist is perfectly OK here
|
||||
|
@ -1361,8 +1365,8 @@ void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct) { }
|
|||
void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState) { }
|
||||
void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState) { }
|
||||
void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState) { }
|
||||
void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) { }
|
||||
void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) { }
|
||||
// void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) { }
|
||||
// void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) { }
|
||||
void TIM_DMAConfig(TIM_TypeDef* TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength) { }
|
||||
void TIM_DMACmd(TIM_TypeDef* TIMx, uint16_t TIM_DMASource, FunctionalState NewState) { }
|
||||
void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState) { }
|
||||
|
|
|
@ -396,11 +396,11 @@ extern uint8_t eeprom[];
|
|||
extern const char * eepromFile;
|
||||
void eepromReadBlock (uint8_t * pointer_ram, uint32_t address, uint32_t size);
|
||||
|
||||
#if !defined(CPUARM)
|
||||
#define wdt_disable(...) sleep(1/*ms*/)
|
||||
#define wdt_enable(...) sleep(1/*ms*/)
|
||||
#define wdt_reset() sleep(1/*ms*/)
|
||||
#define boardInit()
|
||||
#define boardOff()
|
||||
#endif
|
||||
|
||||
#define OS_MutexID pthread_mutex_t
|
||||
extern OS_MutexID audioMutex;
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#ifdef AR9X
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(AR9X)
|
||||
#include "i2c_driver.h"
|
||||
#endif
|
||||
|
||||
|
@ -370,7 +371,7 @@ void opentxBootloader();
|
|||
|
||||
// Set up for volume control (TWI0)
|
||||
// Need PA3 and PA4 set to peripheral A
|
||||
#ifndef AR9X
|
||||
#if !defined(AR9X)
|
||||
void i2cInit()
|
||||
{
|
||||
register Pio *pioptr;
|
||||
|
@ -489,6 +490,10 @@ void boardInit()
|
|||
|
||||
init_SDcard();
|
||||
}
|
||||
#else
|
||||
void boardInit()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t temperature = 0; // Raw temp reading
|
||||
|
|
|
@ -31,6 +31,11 @@ extern uint16_t ResetReason;
|
|||
#define FIRMWARE_SIZE (256*1024)
|
||||
#define FIRMWARE_ADDRESS 0x00400000
|
||||
|
||||
// Board driver
|
||||
void boardInit(void);
|
||||
#define boardOff() pwrOff()
|
||||
|
||||
// Keys
|
||||
#if defined(REVA)
|
||||
#define KEYS_GPIO_REG_MENU PIOB->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_EXIT PIOA->PIO_PDSR
|
||||
|
@ -197,7 +202,11 @@ void disable_dsm2(uint32_t port);
|
|||
#endif
|
||||
|
||||
// WDT driver
|
||||
#if !defined(SIMU)
|
||||
#if defined(SIMU)
|
||||
#define wdt_disable()
|
||||
#define wdt_enable(x)
|
||||
#define wdt_reset()
|
||||
#else
|
||||
#define wdt_disable()
|
||||
#define wdt_enable(x) WDT->WDT_MR = 0x3FFF207F
|
||||
#define wdt_reset() WDT->WDT_CR = 0xA5000001
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
|
@ -110,22 +110,24 @@ extern "C" void INTERRUPT_5MS_IRQHandler()
|
|||
interrupt5ms() ;
|
||||
DEBUG_INTERRUPT(INT_5MS);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(REV9E)
|
||||
#define PWR_PRESS_DURATION_MIN 200 // 2s
|
||||
#define PWR_PRESS_DURATION_MAX 500 // 5s
|
||||
#define PWR_PRESS_DURATION_MIN 200 // 2s
|
||||
#define PWR_PRESS_DURATION_MAX 500 // 5s
|
||||
|
||||
const pm_uchar bmp_startup[] PROGMEM = {
|
||||
const pm_uchar bmp_startup[] PROGMEM = {
|
||||
#include "../../bitmaps/taranis/startup.lbm"
|
||||
};
|
||||
};
|
||||
|
||||
const pm_uchar bmp_lock[] PROGMEM = {
|
||||
const pm_uchar bmp_lock[] PROGMEM = {
|
||||
#include "../../bitmaps/taranis/lock.lbm"
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph | KEYS_RCC_AHB1Periph | LCD_RCC_AHB1Periph | AUDIO_RCC_AHB1Periph | BACKLIGHT_RCC_AHB1Periph | ADC_RCC_AHB1Periph | I2C_RCC_AHB1Periph | SD_RCC_AHB1Periph | HAPTIC_RCC_AHB1Periph | INTMODULE_RCC_AHB1Periph | EXTMODULE_RCC_AHB1Periph | TELEMETRY_RCC_AHB1Periph | SERIAL_RCC_AHB1Periph | TRAINER_RCC_AHB1Periph | HEARTBEAT_RCC_AHB1Periph, ENABLE);
|
||||
RCC_APB1PeriphClockCmd(LCD_RCC_APB1Periph | AUDIO_RCC_APB1Periph | BACKLIGHT_RCC_APB1Periph | INTERRUPT_5MS_APB1Periph | TIMER_2MHz_APB1Periph | I2C_RCC_APB1Periph | SD_RCC_APB1Periph | TRAINER_RCC_APB1Periph | TELEMETRY_RCC_APB1Periph | SERIAL_RCC_APB1Periph, ENABLE);
|
||||
RCC_APB2PeriphClockCmd(BACKLIGHT_RCC_APB2Periph | ADC_RCC_APB2Periph | HAPTIC_RCC_APB2Periph | INTMODULE_RCC_APB2Periph | EXTMODULE_RCC_APB2Periph | HEARTBEAT_RCC_APB2Periph, ENABLE);
|
||||
|
@ -202,6 +204,7 @@ void boardInit()
|
|||
#else
|
||||
backlightInit();
|
||||
#endif
|
||||
#endif // !defined(SIMU)
|
||||
}
|
||||
|
||||
void boardOff()
|
||||
|
@ -222,9 +225,6 @@ void boardOff()
|
|||
pwrOff();
|
||||
}
|
||||
|
||||
#endif // #if !defined(SIMU)
|
||||
|
||||
|
||||
#if defined(USB_JOYSTICK) && !defined(SIMU)
|
||||
extern USB_OTG_CORE_HANDLE USB_OTG_dev;
|
||||
|
||||
|
|
|
@ -136,11 +136,17 @@ extern uint16_t sessionTimer;
|
|||
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_GPIO_DETECT, TRAINER_GPIO_PIN_DETECT) == Bit_RESET)
|
||||
#endif
|
||||
|
||||
// Board driver
|
||||
void boardInit(void);
|
||||
void boardOff(void);
|
||||
|
||||
// Delays driver
|
||||
#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);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -227,8 +233,7 @@ void checkRotaryEncoder(void);
|
|||
#endif
|
||||
|
||||
// WDT driver
|
||||
#if !defined(SIMU)
|
||||
#if defined(WATCHDOG_DISABLED)
|
||||
#if defined(WATCHDOG_DISABLED) || defined(SIMU)
|
||||
#define wdt_enable(x)
|
||||
#define wdt_reset()
|
||||
#else
|
||||
|
@ -240,7 +245,6 @@ void watchdogInit(unsigned int duration);
|
|||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
||||
#endif
|
||||
|
||||
// ADC driver
|
||||
enum Analogs {
|
||||
|
|
|
@ -136,17 +136,26 @@ extern uint8_t telemetryProtocol;
|
|||
#define IS_FRSKY_SPORT_PROTOCOL() (false)
|
||||
#endif
|
||||
|
||||
#if defined(CPUSTM32)
|
||||
#if defined(PCBFLAMENCO)
|
||||
inline uint8_t modelTelemetryProtocol()
|
||||
{
|
||||
return g_model.telemetryProtocol;
|
||||
}
|
||||
#elif defined(CPUSTM32)
|
||||
inline uint8_t modelTelemetryProtocol()
|
||||
{
|
||||
#if defined(CROSSFIRE)
|
||||
if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_CROSSFIRE)
|
||||
if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_CROSSFIRE) {
|
||||
return PROTOCOL_PULSES_CROSSFIRE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) {
|
||||
return g_model.telemetryProtocol;
|
||||
}
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
} else if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_MULTIMODULE) {
|
||||
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_MULTIMODULE) {
|
||||
if (g_model.moduleData[EXTERNAL_MODULE].multi.rfProtocol == MM_RF_PROTO_DSM2)
|
||||
return PROTOCOL_SPEKTRUM;
|
||||
else if ((g_model.moduleData[EXTERNAL_MODULE].multi.rfProtocol == MM_RF_PROTO_FRSKY) && (g_model.moduleData[EXTERNAL_MODULE].subType == 1))
|
||||
|
@ -154,10 +163,11 @@ inline uint8_t modelTelemetryProtocol()
|
|||
return PROTOCOL_FRSKY_D;
|
||||
else
|
||||
return PROTOCOL_FRSKY_SPORT;
|
||||
#endif
|
||||
} else {
|
||||
return PROTOCOL_FRSKY_SPORT;
|
||||
}
|
||||
#endif
|
||||
|
||||
// default choice
|
||||
return PROTOCOL_FRSKY_SPORT;
|
||||
}
|
||||
#define MODEL_TELEMETRY_PROTOCOL() modelTelemetryProtocol()
|
||||
#elif defined(CPUARM)
|
||||
|
|
|
@ -842,7 +842,7 @@ extern const pm_char STR_BLCOLOR[];
|
|||
#define STR_EXPONAME STR_NAME
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#if defined(COLORLCD)
|
||||
#define TR_PHASES_HEADERS { TR_PHASES_HEADERS_NAME, TR_PHASES_HEADERS_SW, TR_PHASES_HEADERS_RUD_TRIM, TR_PHASES_HEADERS_ELE_TRIM, TR_PHASES_HEADERS_THT_TRIM, TR_PHASES_HEADERS_AIL_TRIM, TR_PHASES_HEADERS_CH5_TRIM, TR_PHASES_HEADERS_CH6_TRIM, TR_PHASES_HEADERS_FAD_IN, TR_PHASES_HEADERS_FAD_OUT }
|
||||
#elif defined(PCBTARANIS)
|
||||
#define TR_PHASES_HEADERS { HINT(TR_PHASES_HEADERS_NAME), HINT(TR_PHASES_HEADERS_SW), HINT(TR_PHASES_HEADERS_RUD_TRIM), HINT(TR_PHASES_HEADERS_ELE_TRIM), HINT(TR_PHASES_HEADERS_THT_TRIM), HINT(TR_PHASES_HEADERS_AIL_TRIM), HINT(TR_PHASES_HEADERS_FAD_IN), HINT(TR_PHASES_HEADERS_FAD_OUT) }
|
||||
|
|
|
@ -32,11 +32,11 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
|
|||
extraFilename = "fonts/extra_%dpx.png" % fontsize
|
||||
extraImage = QtGui.QImage(extraFilename)
|
||||
if extraImage.isNull():
|
||||
print("No extra font file", extraFilename)
|
||||
# print("No extra font file", extraFilename)
|
||||
extraImage = None
|
||||
extraWidth = 0
|
||||
extraWidth, extraHeight = 0, 0
|
||||
else:
|
||||
extraWidth = extraImage.size().width() / COUNT_EXTRA_CHARS
|
||||
extraWidth, extraHeight = extraImage.size().width() / COUNT_EXTRA_CHARS, extraImage.size().height()
|
||||
|
||||
def getCharWidth(c):
|
||||
if c in chars_extra:
|
||||
|
@ -78,9 +78,14 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
|
|||
width = 0
|
||||
for c in chars:
|
||||
coords.append(width)
|
||||
painter.setOpacity(1.0)
|
||||
if c in chars_extra:
|
||||
if extraImage and c == chars_extra[0]:
|
||||
painter.drawImage(QtCore.QPoint(width, 0), extraImage)
|
||||
for x in range(extraWidth * COUNT_EXTRA_CHARS):
|
||||
for y in range(extraHeight):
|
||||
rgb = extraImage.pixel(x, y)
|
||||
painter.setOpacity(1.0 - float(QtGui.qGray(rgb)) / 256)
|
||||
painter.drawPoint(x+width, y)
|
||||
elif c == " ":
|
||||
pass
|
||||
elif c == "." and fontsize <= 8:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue