Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2020-06-18 11:14:07 +02:00
121 changed files with 3269 additions and 1775 deletions
+1 -1
View File
@@ -672,7 +672,7 @@ void gpsSendByte(uint8_t byte);
// BT driver
#define BT_TX_FIFO_SIZE 64
#define BT_RX_FIFO_SIZE 128
#define BT_RX_FIFO_SIZE 256
#define BLUETOOTH_BOOTLOADER_BAUDRATE 230400
#define BLUETOOTH_FACTORY_BAUDRATE 57600
#define BLUETOOTH_DEFAULT_BAUDRATE 115200
@@ -74,22 +74,21 @@ void bootloaderDrawScreen(BootloaderState st, int opt, const char* str)
if (st == ST_START) {
bootloaderDrawTitle(88, BOOTLOADER_TITLE);
lcd->drawBitmapPattern(90, 72, LBM_FLASH, DEFAULT_COLOR);
lcd->drawText(124, 75, "Write Firmware");
lcd->drawText(124, 75, "Write Firmware");
lcd->drawBitmapPattern(90, 107, LBM_EXIT, DEFAULT_COLOR);
lcd->drawText(124, 110, "Exit");
lcd->drawBitmapPattern(90, 107, LBM_EXIT, DEFAULT_COLOR);
lcd->drawText(124, 110, "Exit");
lcd->drawSolidRect(119, (opt == 0) ? 72 : 107, 270, 26, 2, LINE_COLOR);
lcd->drawBitmap(60, 166, &BMP_PLUG_USB);
lcd->drawText(195, 175, "Or plug in a USB cable");
lcd->drawText(195, 200, "for mass storage");
lcd->drawSolidRect(119, (opt == 0) ? 72 : 107, 270, 26, 2, LINE_COLOR);
bootloaderDrawFooter();
lcd->drawText( 36, 242, "Current Firmware:");
lcd->drawText(200, 242, getOtherVersion(nullptr));
lcd->drawBitmap(60, 166, &BMP_PLUG_USB);
lcd->drawText(195, 175, "Or plug in a USB cable");
lcd->drawText(195, 200, "for mass storage");
bootloaderDrawFooter();
lcdDrawText(LCD_W / 2, 242, getFirmwareVersion(), CENTERED);
}
else if (st == ST_USB) {
+2 -2
View File
@@ -362,7 +362,7 @@ void extmoduleSendInvertedByte(uint8_t byte)
// wait
}
time += 34;
for (i = 0 ; i < 8 ; i += 1) {
for (i = 0; i < 8; i++) {
if (byte & 1) {
GPIO_ResetBits(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PIN);
}
@@ -376,7 +376,7 @@ void extmoduleSendInvertedByte(uint8_t byte)
time += 35 ;
}
GPIO_ResetBits(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PIN);
__enable_irq() ; // No need to wait for the stop bit to complete
__enable_irq(); // No need to wait for the stop bit to complete
while ((uint16_t) (getTmr2MHz() - time) < 34) {
// wait
}
+15 -1
View File
@@ -51,7 +51,12 @@ inline void LCD_NRST_HIGH()
LCD_GPIO_NRST->BSRRL = LCD_GPIO_PIN_NRST;
}
static void LCD_AF_GPIOConfig(void)
inline bool coordsWithinScreen(coord_t x, coord_t y, coord_t w, coord_t h)
{
return x >= 0 && y >= 0 && x + w <= LCD_W && y + h <= LCD_H;
}
static void LCD_AF_GPIOConfig()
{
GPIO_InitTypeDef GPIO_InitStructure;
@@ -362,6 +367,9 @@ void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, ui
y = desth - (y + h);
#endif
if (dest == displayBuf && !coordsWithinScreen(x, y, w, h))
return;
DMA2D_DeInit();
DMA2D_InitTypeDef DMA2D_InitStruct;
@@ -393,6 +401,9 @@ void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x,
srcy = srch - (srcy + h);
#endif
if (dest == displayBuf && !coordsWithinScreen(x, y, w, h))
return;
DMA2D_DeInit();
DMA2D_InitTypeDef DMA2D_InitStruct;
@@ -433,6 +444,9 @@ void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_
srcy = srch - (srcy + h);
#endif
if (dest == displayBuf && !coordsWithinScreen(x, y, w, h))
return;
DMA2D_DeInit();
DMA2D_InitTypeDef DMA2D_InitStruct;