chore: SDIO conversion to HAL (#3182)
This commit is contained in:
@@ -94,9 +94,12 @@ uint32_t eepromWritten = 0;
|
||||
FlashCheckRes valid;
|
||||
MemoryType memoryType;
|
||||
uint32_t unlocked = 0;
|
||||
uint32_t timer10MsCount;
|
||||
|
||||
|
||||
void interrupt10ms()
|
||||
{
|
||||
timer10MsCount++;
|
||||
tenms |= 1u; // 10 mS has passed
|
||||
g_tmr10ms++;
|
||||
|
||||
@@ -116,6 +119,7 @@ void interrupt10ms()
|
||||
|
||||
void init10msTimer()
|
||||
{
|
||||
timer10MsCount = 0;
|
||||
INTERRUPT_xMS_TIMER->ARR = 9999; // 10mS in uS
|
||||
INTERRUPT_xMS_TIMER->PSC = (PERI1_FREQUENCY * TIMER_MULT_APB1) / 1000000 - 1; // 1uS
|
||||
INTERRUPT_xMS_TIMER->CCER = 0;
|
||||
@@ -126,6 +130,11 @@ void init10msTimer()
|
||||
NVIC_EnableIRQ(INTERRUPT_xMS_IRQn);
|
||||
}
|
||||
|
||||
extern "C" uint32_t HAL_GetTick(void)
|
||||
{
|
||||
return timer10MsCount*10;
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void INTERRUPT_xMS_IRQHandler()
|
||||
{
|
||||
@@ -188,8 +197,6 @@ int menuFlashFile(uint32_t index, event_t event)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static uint32_t PowerUpDelay;
|
||||
|
||||
void flashWriteBlock()
|
||||
{
|
||||
uint32_t blockOffset = 0;
|
||||
@@ -571,12 +578,16 @@ int bootloaderMain()
|
||||
|
||||
lcdRefresh();
|
||||
|
||||
#if defined(SDCARD) && defined(PCBTARANIS)
|
||||
static uint32_t PowerUpDelay = 0;
|
||||
|
||||
if (PowerUpDelay < 20) { // 200 mS
|
||||
PowerUpDelay += 1;
|
||||
}
|
||||
else {
|
||||
sdPoll10ms();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (state != ST_FLASHING && state != ST_USB) {
|
||||
|
||||
Reference in New Issue
Block a user