1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-21 11:54:15 +01:00

Remove all references to vTaskDelay in the flash code as it can run before the

FreeRTOS scheduler

Also increaes init stack size from 0x80 to 0x100
This commit is contained in:
James Cotton 2011-07-15 18:06:18 -05:00
parent 01b62cf98f
commit b83f731c03
4 changed files with 58 additions and 52 deletions

View File

@ -142,11 +142,10 @@ int8_t PIOS_Flash_W25X_EraseSector(uint32_t addr)
PIOS_SPI_TransferBlock(PIOS_SPI_FLASH,out,NULL,sizeof(out),NULL);
PIOS_Flash_W25X_ReleaseBus();
uint32_t i = 1;
while(PIOS_Flash_W25X_Busy()) {
//TODO: Fail on timeout
#if defined(PIOS_INCLUDE_FREERTOS)
vTaskDelay(1);
#endif
if(++i == 0)
return -1;
}
return 0;
@ -168,12 +167,13 @@ int8_t PIOS_Flash_W25X_EraseChip()
return -1;
PIOS_SPI_TransferBlock(PIOS_SPI_FLASH,out,NULL,sizeof(out),NULL);
PIOS_Flash_W25X_ReleaseBus();
uint32_t i = 1;
while(PIOS_Flash_W25X_Busy()) {
//TODO: Fail on timeout
#if defined(PIOS_INCLUDE_FREERTOS)
vTaskDelay(1);
#endif
if(++i == 0)
return -1;
}
return 0;
}
@ -214,11 +214,12 @@ int8_t PIOS_Flash_W25X_WriteData(uint32_t addr, uint8_t * data, uint16_t len)
PIOS_Flash_W25X_ReleaseBus();
uint32_t i = 1;
while(PIOS_Flash_W25X_Busy()) {
#if defined(PIOS_INCLUDE_FREERTOS)
vTaskDelay(1);
#endif
if(++i == 0)
return -1;
}
return 0;
}

View File

@ -80,9 +80,10 @@ int32_t PIOS_FLASHFS_Init()
return -1;
if(object_table_magic != OBJECT_TABLE_MAGIC) {
if(magic_fail_count++ > MAX_BADMAGIC) {
magic_fail_count = 0;
PIOS_FLASHFS_ClearObjectTableHeader();
PIOS_DELAY_WaituS(100);
PIOS_LED_Toggle(LED1);
magic_fail_count = 0;
magic_good = true;
} else {
PIOS_DELAY_WaituS(100);
}

View File

@ -1,7 +1,7 @@
/* This is the size of the stack for all FreeRTOS IRQs */
_irq_stack_size = 0x180;
/* This is the size of the stack for early init: life span is until scheduler starts */
_init_stack_size = 0x80;
_init_stack_size = 0x100;
/* there is probably a way to get that from the MEMORY section */
_eram = ORIGIN(SRAM) + LENGTH(SRAM);

View File

@ -90,6 +90,8 @@
65632DF51251650300469B77 /* pios_board.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_board.h; sourceTree = "<group>"; };
65632DF61251650300469B77 /* STM32103CB_AHRS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STM32103CB_AHRS.h; sourceTree = "<group>"; };
65632DF71251650300469B77 /* STM3210E_OP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STM3210E_OP.h; sourceTree = "<group>"; };
6572CB1613D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_memory.ld */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = link_STM32103CB_CC_Rev1_memory.ld; path = ../../PiOS/STM32F10x/link_STM32103CB_CC_Rev1_memory.ld; sourceTree = SOURCE_ROOT; };
6572CB1713D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_sections.ld */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = link_STM32103CB_CC_Rev1_sections.ld; path = ../../PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld; sourceTree = SOURCE_ROOT; };
657CEEAD121DB6C8007A1FBE /* homelocation.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = homelocation.xml; sourceTree = "<group>"; };
657CEEB7121DBC63007A1FBE /* CoordinateConversions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CoordinateConversions.c; sourceTree = "<group>"; };
657CEEB9121DBC63007A1FBE /* CoordinateConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoordinateConversions.h; sourceTree = "<group>"; };
@ -7761,6 +7763,8 @@
65E8F05911EFF25C00BBF654 /* Libraries */ = {
isa = PBXGroup;
children = (
6572CB1613D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_memory.ld */,
6572CB1713D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_sections.ld */,
65E8F05A11EFF25C00BBF654 /* CMSIS */,
65E8F06B11EFF25C00BBF654 /* dosfs */,
65E8F07111EFF25C00BBF654 /* FreeRTOS */,