More minor alignment of f3 to f4 port

This commit is contained in:
zvecr 2023-01-19 10:47:36 +00:00
parent 7312c15fcf
commit d8a1aded7b
6 changed files with 17 additions and 12 deletions

View file

@ -28,13 +28,14 @@
#include "tusb.h"
#endif
//--------------------------------------------------------------------+
//
//--------------------------------------------------------------------+
#define FLASH_CACHE_SIZE 512
#define FLASH_CACHE_INVALID_ADDR 0xffffffff
//--------------------------------------------------------------------+
//define flash space, reserve first 8 sectors for bootloader up to 3FFF
//--------------------------------------------------------------------+
// define flash space, reserve first 8 sectors for bootloader up to 3FFF
#define BOARD_FLASH_SECTORS 64
#define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 8
@ -54,10 +55,16 @@ uint32_t flash_func_sector_size(unsigned sector)
return 0;
}
//--------------------------------------------------------------------+
//
//--------------------------------------------------------------------+
static bool is_blank(uint32_t addr, uint32_t size)
{
for (uint32_t i = 0; i < size; i += sizeof(uint32_t)) {
if (*(uint32_t*)(addr + i) != 0xffffffff) {
for ( uint32_t i = 0; i < size; i += sizeof(uint32_t) )
{
if ( *(uint32_t*) (addr + i) != 0xffffffff )
{
return false;
}
}

View file

@ -132,10 +132,8 @@ bool board_app_valid(void)
if((((*(uint32_t*)BOARD_FLASH_APP_START) - BOARD_RAM_START) <= BOARD_RAM_SIZE)) // && ((*(uint32_t*)BOARD_FLASH_APP_START + 4) > BOARD_FLASH_APP_START) && ((*(uint32_t*)BOARD_FLASH_APP_START + 4) < BOARD_FLASH_APP_START + BOARD_FLASH_SIZE)
{
return true;
} else
{
return false;
}
return false;
}
void board_app_jump(void)

View file

@ -45,8 +45,6 @@
// Double Reset tap to enter DFU
#define TINYUF2_DFU_DOUBLE_TAP 1
//#define USE_RGB NEOPIXEL_NUMBER
// Brightness percentage from 1 to 255
#ifndef NEOPIXEL_BRIGHTNESS
#define NEOPIXEL_BRIGHTNESS 0x10

View file

@ -20,7 +20,7 @@ CFLAGS += \
CFLAGS += -Wno-error=cast-align -Wno-error=unused-parameter
# default linker file
LD_FILES ?= $(PORT_DIR)/linker/STM32F303VCTx_FLASH.ld
LD_FILES ?= $(PORT_DIR)/linker/stm32f3_boot.ld
# Port source
SRC_C += \

View file

@ -87,6 +87,8 @@
// MSC Buffer size of Device Mass storage
#define CFG_TUD_MSC_BUFSIZE 512
// HID buffer size Should be sufficient to hold ID (if any) + Data
#define CFG_TUD_HID_BUFSIZE 64
#ifdef __cplusplus