diff --git a/companion/src/firmwares/opentx/simulator/CMakeLists.txt b/companion/src/firmwares/opentx/simulator/CMakeLists.txt index 062a8f4cd..63531c07d 100644 --- a/companion/src/firmwares/opentx/simulator/CMakeLists.txt +++ b/companion/src/firmwares/opentx/simulator/CMakeLists.txt @@ -21,7 +21,7 @@ add_custom_target(commondeps set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h) add_custom_target(lua_exports - make PCB=TARANIS lua_exports.inc + make PCB=TARANIS lua_exports_taranis.inc WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} ) diff --git a/radio/src/gui/Horus/lcd.cpp b/radio/src/gui/Horus/lcd.cpp index c65c059a6..b982f1d84 100644 --- a/radio/src/gui/Horus/lcd.cpp +++ b/radio/src/gui/Horus/lcd.cpp @@ -116,80 +116,14 @@ void lcdDrawBitmapPattern(coord_t x, coord_t y, const uint8_t * img, LcdFlags fl #define FONT_MAX_HEIGHT 42 void lcdPutFontPattern(coord_t x, coord_t y, const uint8_t * font, const uint16_t * spec, int index, LcdFlags flags) { - bool blink = false; - bool inv = false; - if (flags & BLINK) { - if (BLINK_ON_PHASE) { - if (flags & INVERS) - inv = true; - else { - blink = true; - } - } - } - else if (flags & INVERS) { - inv = true; - } - - coord_t w = *((uint16_t *)font); - coord_t width = getFontPatternWidth(spec, index); - coord_t height = *(((uint16_t *)font)+1); - - assert(height <= FONT_MAX_HEIGHT); - - for (int i=0; i> 8; const pm_uchar * font = fontsTable[fontindex]; const uint16_t * fontspecs = fontspecsTable[fontindex]; @@ -216,9 +150,9 @@ int getFontHeight(LcdFlags flags) return heightTable[FONTSIZE(flags) >> 8]; } -int getTextWidth(const pm_char *s, int len, LcdFlags flags) +int getTextWidth(const pm_char * s, int len, LcdFlags flags) { - const uint16_t *specs = fontspecsTable[FONTSIZE(flags) >> 8]; + const uint16_t * specs = fontspecsTable[FONTSIZE(flags) >> 8]; int result = 0; for (int i=0; (len==0 || i> 8; + const pm_uchar * font = fontsTable[fontindex]; + const uint16_t * fontspecs = fontspecsTable[fontindex]; - if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) { - if ((COLOR_IDX(flags) == TEXT_COLOR_INDEX)) { - flags += TEXT_INVERTED_COLOR - TEXT_COLOR; - if (FONTSIZE(flags) == TINSIZE) - lcdDrawFilledRect(x-INVERT_HORZ_MARGIN+2, y-INVERT_VERT_MARGIN+2, width+2*INVERT_HORZ_MARGIN-5, INVERT_LINE_HEIGHT-7, TEXT_INVERTED_BGCOLOR); - else if (FONTSIZE(flags) == SMLSIZE) - lcdDrawFilledRect(x-INVERT_HORZ_MARGIN+1, y-INVERT_VERT_MARGIN, width+2*INVERT_HORZ_MARGIN-2, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); - else - lcdDrawFilledRect(x-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); - } - flags &= ~(INVERS|BLINK); + if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE) && (COLOR_IDX(flags) == TEXT_COLOR_INDEX)) { + flags += TEXT_INVERTED_COLOR - TEXT_COLOR; + if (FONTSIZE(flags) == TINSIZE) + lcdDrawFilledRect(x-INVERT_HORZ_MARGIN+2, y-INVERT_VERT_MARGIN+2, width+2*INVERT_HORZ_MARGIN-5, INVERT_LINE_HEIGHT-7, TEXT_INVERTED_BGCOLOR); + else if (FONTSIZE(flags) == SMLSIZE) + lcdDrawFilledRect(x-INVERT_HORZ_MARGIN+1, y-INVERT_VERT_MARGIN, width+2*INVERT_HORZ_MARGIN-2, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); + else + lcdDrawFilledRect(x-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); } char str[256]; @@ -272,7 +206,7 @@ void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags break; } else if (c >= 0x20) { - lcd_putcAtt(x, y, c, flags); + lcdPutFontPattern(x, y, font, fontspecs, getMappedChar(c), flags); x = lcdNextPos; } else if (c == 0x1F) { // X-coord prefix diff --git a/radio/src/gui/Horus/lcd.h b/radio/src/gui/Horus/lcd.h index 9fe05c00b..71b833bb9 100644 --- a/radio/src/gui/Horus/lcd.h +++ b/radio/src/gui/Horus/lcd.h @@ -238,7 +238,7 @@ void lcd_line(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, #if !defined(SIMU) inline void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att) { - lcdFillRectangle(x, y, w, h, lcdColorTable[COLOR_IDX(att)]); + lcdDrawFilledRectDMA(x, y, w, h, lcdColorTable[COLOR_IDX(att)]); } #else void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att); @@ -266,9 +266,10 @@ void lcdDrawFilledRectWithAttributes(coord_t x, scoord_t y, coord_t w, coord_t h void drawBlackOverlay(); void lcd_rect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0); -inline void lcd_square(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcd_rect(x, y, w, w, SOLID, att); } - -void lcdDrawTelemetryTopBar(); +inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) +{ + lcdDrawRect(x, y, w, w, att); +} #define V_BAR(xx, yy, ll) \ lcd_vline(xx-1,yy-ll,ll); \ @@ -283,10 +284,8 @@ void lcdDrawBitmapPattern(coord_t x, coord_t y, const uint8_t * img, LcdFlags fl #define lcdSetRefVolt(...) void lcdSetContrast(); -void lcdInit(); #define lcdOff(...) -void lcdRefresh(); void lcdSendByte(uint8_t data); void lcdSend(const uint8_t * data, uint32_t size); void lcdSendString(const char * s); diff --git a/radio/src/gui/Horus/view_main.cpp b/radio/src/gui/Horus/view_main.cpp index 6d75f4aae..411b5b777 100644 --- a/radio/src/gui/Horus/view_main.cpp +++ b/radio/src/gui/Horus/view_main.cpp @@ -138,7 +138,7 @@ void displayTrims(uint8_t phase) lcd_vline(xm, ym-1, 3); } } - lcd_square(xm-3, ym-3, 7, att); + lcdDrawSquare(xm-3, ym-3, 7, att); } } diff --git a/radio/src/gui/Horus/widgets.cpp b/radio/src/gui/Horus/widgets.cpp index de9846e35..bda3da69e 100644 --- a/radio/src/gui/Horus/widgets.cpp +++ b/radio/src/gui/Horus/widgets.cpp @@ -53,10 +53,10 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval) #define BOX_CENTERY (170 - FH - BOX_WIDTH/2) #define MARKER_WIDTH 5 - lcd_square(centrex-BOX_WIDTH/2, BOX_CENTERY-BOX_WIDTH/2, BOX_WIDTH, TEXT_COLOR); + lcdDrawSquare(centrex-BOX_WIDTH/2, BOX_CENTERY-BOX_WIDTH/2, BOX_WIDTH, TEXT_COLOR); lcd_vlineStip(centrex, BOX_CENTERY-1, 3, SOLID, TEXT_COLOR); lcd_hlineStip(centrex-1, BOX_CENTERY, 3, SOLID, TEXT_COLOR); - lcd_square(centrex + (xval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, BOX_CENTERY - (yval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, MARKER_WIDTH, ROUND|TEXT_COLOR); + lcdDrawSquare(centrex + (xval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, BOX_CENTERY - (yval/((2*RESX)/(BOX_WIDTH-MARKER_WIDTH))) - MARKER_WIDTH/2, MARKER_WIDTH, ROUND|TEXT_COLOR); #undef BOX_CENTERY #undef MARKER_WIDTH diff --git a/radio/src/pulses/ppm_arm.cpp b/radio/src/pulses/ppm_arm.cpp index edd21c5fb..44dc5cb04 100644 --- a/radio/src/pulses/ppm_arm.cpp +++ b/radio/src/pulses/ppm_arm.cpp @@ -61,7 +61,7 @@ void setupPulsesPPM(unsigned int port) // Don't enable interru PpmPulsesData * ppmPulsesData = (port == TRAINER_MODULE ? &trainerPulsesData.ppm : &modulePulsesData[port].ppm); uint16_t * ptr = ppmPulsesData->pulses; -#if defined(PCBSKY9X) +#if defined(PPM_PIN_HW_SERIAL) ppmPulsesData->index = 0; #else ppmPulsesData->ptr = ptr; diff --git a/radio/src/pulses/pulses_arm.h b/radio/src/pulses/pulses_arm.h index 9c9927a1a..118b45db2 100644 --- a/radio/src/pulses/pulses_arm.h +++ b/radio/src/pulses/pulses_arm.h @@ -47,7 +47,7 @@ extern uint8_t s_current_protocol[NUM_MODULES]; extern uint8_t s_pulses_paused; extern uint16_t failsafeCounter[NUM_MODULES]; -#if defined(PCBSKY9X) +#if defined(PPM_PIN_HW_SERIAL) PACK(struct PpmPulsesData { uint16_t pulses[20]; uint32_t index; diff --git a/radio/src/targets/Horus/board_horus.h b/radio/src/targets/Horus/board_horus.h index 45f1438d2..caf84cdb4 100644 --- a/radio/src/targets/Horus/board_horus.h +++ b/radio/src/targets/Horus/board_horus.h @@ -250,7 +250,9 @@ void ledRed(void); void ledBlue(void); // LCD driver -void lcdDrawFullRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color); +void lcdInit(void); +void lcdRefresh(void); +void lcdDrawFilledRectDMA(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color); // Backlight driver #define setBacklight(xx) diff --git a/radio/src/targets/Horus/lcd_driver.cpp b/radio/src/targets/Horus/lcd_driver.cpp index 536eeaf5d..5af5c9d9e 100644 --- a/radio/src/targets/Horus/lcd_driver.cpp +++ b/radio/src/targets/Horus/lcd_driver.cpp @@ -18,7 +18,7 @@ #define LCD_BACKGROUND_LAYER 0x0000 #define LCD_FOREGROUND_LAYER 0x0001 -#define LCD_BKLIGHT_PWM_FREQ 300 +#define LCD_BKLIGHT_PWM_FREQ 300 #define LCD_DEFAULT_FRAME_BUFFER SDRAM_BANK_ADDR #define FRAME_BUFFER_OFFSET ((uint32_t)0x100000) @@ -439,7 +439,7 @@ void lcdInit(void) LCD_SetTransparency(255); } -void lcdDrawFullRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) +void lcdDrawFilledRectDMA(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) { uint32_t addr = CurrentFrameBuffer + 2*(LCD_PIXEL_WIDTH*y + x); uint16_t red = (0xF800 & color) >> 11; @@ -465,7 +465,7 @@ void lcdDrawFullRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t co DMA2D_StartTransfer(); /* Wait for CTC Flag activation */ - while(DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET); + while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET); } void lcdRefresh() @@ -476,5 +476,4 @@ void lcdRefresh() else LCD_SetLayer(LCD_BACKGROUND_LAYER); LCD_SetTransparency(0); - // memcpy((void *)(SDRAM_BANK_ADDR+FRAME_BUFFER_OFFSET), (void *)SDRAM_BANK_ADDR, 480*272*2); } diff --git a/radio/src/tasks_arm.cpp b/radio/src/tasks_arm.cpp index 26442ae0b..523153b33 100644 --- a/radio/src/tasks_arm.cpp +++ b/radio/src/tasks_arm.cpp @@ -197,7 +197,8 @@ void menusTask(void * pdata) BACKLIGHT_OFF(); -#if defined(PCBTARANIS) +#if defined(COLORLCD) +#elif defined(PCBTARANIS) displaySleepBitmap(); #else lcd_clear(); diff --git a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h index 030e35c38..a49985ba2 100644 --- a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h +++ b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h @@ -30,7 +30,7 @@ #define __USBD_CORE_H /* Includes ------------------------------------------------------------------*/ -#include "../../../../../../targets/Flamenco/usbd_conf.h" +#include "usbd_conf.h" #include "../../../STM32_USB_OTG_Driver/inc/usb_dcd.h" #include "usbd_def.h" diff --git a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h index 467f5f822..87b0f5444 100644 --- a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h +++ b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h @@ -31,7 +31,7 @@ #define __USB_REQUEST_H_ /* Includes ------------------------------------------------------------------*/ -#include "../../../../../../targets/Flamenco/usbd_conf.h" +#include "usbd_conf.h" #include "usbd_def.h" #include "usbd_core.h" diff --git a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c index 8a5f8390d..cd7a409d9 100644 --- a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c +++ b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c @@ -28,7 +28,7 @@ /* Includes ------------------------------------------------------------------*/ #include "usbd_req.h" -#include "../../../../../../targets/Flamenco/usbd_desc.h" +#include "usbd_desc.h" #include "usbd_ioreq.h" diff --git a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h index ee651a992..8e0d264f4 100644 --- a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h +++ b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h @@ -30,7 +30,7 @@ #define __USB_DEF_H__ /* Includes ------------------------------------------------------------------*/ -#include "../../../../../targets/Flamenco/usb_conf.h" +#include "usb_conf.h" /** @addtogroup USB_OTG_DRIVER * @{ diff --git a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h index cc490c0ed..323e87056 100644 --- a/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h +++ b/radio/src/thirdparty/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h @@ -30,7 +30,7 @@ #define __USB_OTG_REGS_H__ /* Includes ------------------------------------------------------------------*/ -#include "../../../../../targets/Flamenco/usb_conf.h" +#include "usb_conf.h" /** @addtogroup USB_OTG_DRIVER