Changes for menu
* Make Systick a 100us Timer. Millisecond ticks are still untouched. * LCD now has a 100us resolution tick * LCD uses 500us delay for waitstate * Make 'About' menu verbose: * Add 3 page menu * 1st page: Generic info * 2nd page: Version info * 3rd page: Uptime in seconds
This commit is contained in:
@@ -28,11 +28,11 @@
|
||||
|
||||
volatile uint32_t wait_tick_ms = 0UL;
|
||||
volatile uint64_t global_tick_ms = 0ULL;
|
||||
volatile uint32_t lcd_tick_ms = 0UL;
|
||||
volatile uint32_t lcd_tick_100us = 0UL;
|
||||
|
||||
void systick_setup(void)
|
||||
{
|
||||
/* Setup Systick for 1ms tick @ 168 MHz Clock Speed */
|
||||
/* Setup Systick for 100us tick @ 168 MHz Clock Speed */
|
||||
SysTick_Config(SYSTICK_RELOAD);
|
||||
}
|
||||
|
||||
@@ -82,8 +82,14 @@ bool __attribute__((optimize("O3"))) systick_ticks_have_passed(uint64_t start_ti
|
||||
*/
|
||||
void __attribute__((optimize("O3"))) SysTick_Handler()
|
||||
{
|
||||
/* Increase tick counters */
|
||||
wait_tick_ms++;
|
||||
global_tick_ms++;
|
||||
lcd_tick_ms++;
|
||||
static uint32_t pre_tick = 0UL;
|
||||
|
||||
pre_tick++;
|
||||
if (pre_tick == 10) {
|
||||
pre_tick = 0;
|
||||
/* Increase tick counters */
|
||||
wait_tick_ms++;
|
||||
global_tick_ms++;
|
||||
}
|
||||
lcd_tick_100us++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user