[Horus] S.PORT devices update should work (not tested)
[Horus] SD Manager files renaming fixed (quick & dirty, I would prefer a popup)
This commit is contained in:
@@ -84,6 +84,7 @@ set(SRC
|
||||
main_arm.cpp
|
||||
tasks_arm.cpp
|
||||
audio_arm.cpp
|
||||
io/frsky_sport.cpp
|
||||
telemetry/telemetry.cpp
|
||||
telemetry/telemetry_holders.cpp
|
||||
telemetry/telemetry_sensors.cpp
|
||||
|
||||
@@ -87,6 +87,7 @@ set(SRC
|
||||
${SRC}
|
||||
sbus.cpp
|
||||
telemetry/crossfire.cpp
|
||||
io/bootloader_flash.cpp
|
||||
)
|
||||
set(PULSES_SRC
|
||||
${PULSES_SRC}
|
||||
|
||||
@@ -759,7 +759,7 @@ int32_t fat12Write(const uint8_t * buffer, uint16_t sector, uint16_t count)
|
||||
operation = FATWRITE_FIRMWARE;
|
||||
}
|
||||
if (operation == FATWRITE_FIRMWARE) {
|
||||
writeFlash((uint32_t *)address, (uint32_t *)buffer);
|
||||
flashWrite((uint32_t *)address, (uint32_t *)buffer);
|
||||
}
|
||||
}
|
||||
address += FLASH_PAGESIZE;
|
||||
|
||||
@@ -145,9 +145,9 @@ DRESULT __disk_write(BYTE drv, const BYTE * buff, DWORD sector, UINT count);
|
||||
#define FLASH_PAGESIZE 256
|
||||
void unlockFlash(void);
|
||||
void lockFlash(void);
|
||||
void writeFlash(uint32_t * address, uint32_t * buffer);
|
||||
uint32_t isFirmwareStart(const void * buffer);
|
||||
uint32_t isBootloaderStart(const void * buffer);
|
||||
void flashWrite(uint32_t * address, uint32_t * buffer);
|
||||
uint32_t isFirmwareStart(const uint8_t * buffer);
|
||||
uint32_t isBootloaderStart(const uint8_t * buffer);
|
||||
|
||||
// SDRAM driver
|
||||
void SDRAM_Init(void);
|
||||
|
||||
@@ -182,7 +182,7 @@ const char * OpenTxSimulator::getError()
|
||||
void OpenTxSimulator::sendTelemetry(uint8_t * data, unsigned int len)
|
||||
{
|
||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
||||
processSportPacket(data);
|
||||
sportProcessTelemetryPacket(data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1233,8 +1233,8 @@ FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG) { return SET; }
|
||||
ErrorStatus RTC_WaitForSynchro(void) { return SUCCESS; }
|
||||
void unlockFlash() { }
|
||||
void lockFlash() { }
|
||||
void writeFlash(uint32_t *address, uint32_t *buffer) { SIMU_SLEEP(100); }
|
||||
uint32_t isBootloaderStart(const void *block) { return 1; }
|
||||
void flashWrite(uint32_t *address, uint32_t *buffer) { SIMU_SLEEP(100); }
|
||||
uint32_t isBootloaderStart(const uint8_t * block) { return 1; }
|
||||
#endif // defined(PCBTARANIS)
|
||||
|
||||
#if defined(PCBFLAMENCO)
|
||||
|
||||
@@ -234,7 +234,7 @@ void init_trainer_capture();
|
||||
|
||||
// Write Flash driver
|
||||
#define FLASH_PAGESIZE 256
|
||||
void writeFlash(uint32_t * address, uint32_t * buffer);
|
||||
void flashWrite(uint32_t * address, uint32_t * buffer);
|
||||
|
||||
// Keys driver
|
||||
uint8_t keyState(uint8_t index);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
uint32_t (*IAP_Function)(uint32_t, uint32_t);
|
||||
|
||||
void writeFlash(uint32_t *address, uint32_t *buffer) // size is 256 bytes
|
||||
void flashWrite(uint32_t *address, uint32_t *buffer) // size is 256 bytes
|
||||
{
|
||||
uint32_t FlashSectorNum;
|
||||
uint32_t flash_cmd = 0;
|
||||
@@ -76,7 +76,7 @@ void clearLockBits()
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t isFirmwareStart(const void * buffer)
|
||||
uint32_t isFirmwareStart(const uint8_t * buffer)
|
||||
{
|
||||
const uint32_t * block = (const uint32_t *)buffer;
|
||||
|
||||
|
||||
@@ -155,9 +155,9 @@ uint32_t sdMounted(void);
|
||||
#define FLASH_PAGESIZE 256
|
||||
void unlockFlash(void);
|
||||
void lockFlash(void);
|
||||
void writeFlash(uint32_t * address, uint32_t * buffer);
|
||||
uint32_t isFirmwareStart(const void * buffer);
|
||||
uint32_t isBootloaderStart(const void * buffer);
|
||||
void flashWrite(uint32_t * address, uint32_t * buffer);
|
||||
uint32_t isFirmwareStart(const uint8_t * buffer);
|
||||
uint32_t isBootloaderStart(const uint8_t * buffer);
|
||||
|
||||
// Pulses driver
|
||||
#define INTERNAL_MODULE_ON() GPIO_SetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN)
|
||||
|
||||
@@ -64,8 +64,6 @@ enum MemoryTypes {
|
||||
MEM_EEPROM
|
||||
};
|
||||
|
||||
#define BLOCK_LEN 4096
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Local variables
|
||||
*----------------------------------------------------------------------------*/
|
||||
@@ -89,7 +87,8 @@ TCHAR Filenames[20][50];
|
||||
uint32_t FileSize[20];
|
||||
uint32_t Valid;
|
||||
|
||||
uint32_t Block_buffer[1024];
|
||||
#define BLOCK_LEN 4096
|
||||
uint8_t Block_buffer[BLOCK_LEN];
|
||||
UINT BlockCount;
|
||||
|
||||
uint32_t memoryType;
|
||||
@@ -229,7 +228,7 @@ FRESULT openBinaryFile(uint32_t index)
|
||||
return fr;
|
||||
}
|
||||
}
|
||||
fr = f_read(&FlashFile, (BYTE *)Block_buffer, BLOCK_LEN, &BlockCount);
|
||||
fr = f_read(&FlashFile, Block_buffer, BLOCK_LEN, &BlockCount);
|
||||
|
||||
if (BlockCount == BLOCK_LEN)
|
||||
return fr;
|
||||
@@ -237,7 +236,7 @@ FRESULT openBinaryFile(uint32_t index)
|
||||
return FR_INVALID_OBJECT;
|
||||
}
|
||||
|
||||
uint32_t isValidBufferStart(const void * buffer)
|
||||
uint32_t isValidBufferStart(const uint8_t * buffer)
|
||||
{
|
||||
if (memoryType == MEM_FLASH)
|
||||
return isFirmwareStart(buffer);
|
||||
@@ -295,12 +294,12 @@ extern Key keys[];
|
||||
|
||||
static uint32_t PowerUpDelay;
|
||||
|
||||
void writeFlashBlock()
|
||||
void flashWriteBlock()
|
||||
{
|
||||
uint32_t blockOffset = 0;
|
||||
while (BlockCount) {
|
||||
writeFlash((uint32_t *)firmwareAddress, &Block_buffer[blockOffset]);
|
||||
blockOffset += FLASH_PAGESIZE/4; // 32-bit words
|
||||
flashWrite((uint32_t *)firmwareAddress, (uint32_t *)&Block_buffer[blockOffset]);
|
||||
blockOffset += FLASH_PAGESIZE;
|
||||
firmwareAddress += FLASH_PAGESIZE;
|
||||
if (BlockCount > FLASH_PAGESIZE) {
|
||||
BlockCount -= FLASH_PAGESIZE;
|
||||
@@ -313,7 +312,7 @@ void writeFlashBlock()
|
||||
|
||||
void writeEepromBlock()
|
||||
{
|
||||
eepromWriteBlock((uint8_t *)Block_buffer, eepromAddress, BlockCount);
|
||||
eepromWriteBlock(Block_buffer, eepromAddress, BlockCount);
|
||||
eepromAddress += BlockCount;
|
||||
}
|
||||
|
||||
@@ -551,7 +550,7 @@ int main()
|
||||
|
||||
int progress;
|
||||
if (memoryType == MEM_FLASH) {
|
||||
writeFlashBlock();
|
||||
flashWriteBlock();
|
||||
firmwareWritten += sizeof(Block_buffer);
|
||||
progress = (200*firmwareWritten) / FirmwareSize;
|
||||
}
|
||||
@@ -566,7 +565,7 @@ int main()
|
||||
lcdDrawSolidHorizontalLine(5, 6*FH+7, progress, FORCE);
|
||||
lcdDrawSolidHorizontalLine(5, 6*FH+8, progress, FORCE);
|
||||
|
||||
fr = f_read(&FlashFile, (BYTE *)Block_buffer, sizeof(Block_buffer), &BlockCount);
|
||||
fr = f_read(&FlashFile, Block_buffer, sizeof(Block_buffer), &BlockCount);
|
||||
if (BlockCount == 0) {
|
||||
state = ST_FLASH_DONE; // EOF
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ void eraseSector(uint32_t sector)
|
||||
FLASH->CR &= SECTOR_MASK;
|
||||
}
|
||||
|
||||
void writeFlash(uint32_t *address, uint32_t *buffer) // page size is 256 bytes
|
||||
void flashWrite(uint32_t * address, uint32_t * buffer) // page size is 256 bytes
|
||||
{
|
||||
if ((uint32_t) address == 0x08000000) {
|
||||
eraseSector(0);
|
||||
@@ -123,7 +123,7 @@ void writeFlash(uint32_t *address, uint32_t *buffer) // page size is 256 bytes
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t isFirmwareStart(const void * buffer)
|
||||
uint32_t isFirmwareStart(const uint8_t * buffer)
|
||||
{
|
||||
const uint32_t * block = (const uint32_t *)buffer;
|
||||
|
||||
@@ -151,7 +151,7 @@ uint32_t isFirmwareStart(const void * buffer)
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t isBootloaderStart(const void * buffer)
|
||||
uint32_t isBootloaderStart(const uint8_t * buffer)
|
||||
{
|
||||
const uint32_t * block = (const uint32_t *)buffer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user