mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
fixed LED bug, now blinks faster without problems
This commit is contained in:
@@ -17,11 +17,12 @@ int main(void)
|
||||
|
||||
while(1) {
|
||||
if (SystemTick100ms()) {
|
||||
LEDTick(); // this has to be the first function called here, since it is time-critical - the functions below may have non-negligible runtimes!
|
||||
|
||||
RandomTick();
|
||||
TerminalTick();
|
||||
ButtonTick();
|
||||
LogTick();
|
||||
LEDTick();
|
||||
ApplicationTick();
|
||||
CommandLineTick();
|
||||
AntennaLevelTick();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Terminal/CommandLine.h"
|
||||
#include "System.h"
|
||||
|
||||
#define BLINK_PRESCALER 2 /* x LEDTick(); */
|
||||
#define BLINK_PRESCALER 1 /* x LEDTick(); */
|
||||
|
||||
LEDActionEnum LEDGreenAction = LED_NO_ACTION;
|
||||
LEDActionEnum LEDRedAction = LED_NO_ACTION;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "Common.h"
|
||||
#include "Settings.h"
|
||||
#include "LEDHook.h"
|
||||
#include "System.h"
|
||||
|
||||
#define USE_DMA
|
||||
#define RECV_DMA DMA.CH0
|
||||
@@ -395,6 +396,8 @@ void MemoryRecall(void)
|
||||
{
|
||||
/* Recall memory from permanent flash */
|
||||
FlashToFRAM((uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING);
|
||||
|
||||
SystemTickClearFlag();
|
||||
}
|
||||
|
||||
void MemoryStore(void)
|
||||
@@ -404,6 +407,8 @@ void MemoryStore(void)
|
||||
|
||||
LEDHook(LED_MEMORY_CHANGED, LED_OFF);
|
||||
LEDHook(LED_MEMORY_STORED, LED_PULSE);
|
||||
|
||||
SystemTickClearFlag();
|
||||
}
|
||||
|
||||
bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount)
|
||||
|
||||
@@ -51,6 +51,14 @@ INLINE bool SystemTick100ms(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
INLINE void SystemTickClearFlag(void)
|
||||
{
|
||||
while(RTC.STATUS & RTC_SYNCBUSY_bm)
|
||||
;
|
||||
|
||||
RTC.INTFLAGS = RTC_COMPIF_bm;
|
||||
}
|
||||
|
||||
INLINE uint16_t SystemGetSysTick(void) {
|
||||
return SYSTEM_TICK_REGISTER | RTC.CNT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user