Changeset - 736f2e74e445
[Not reviewed]
default
0 1 0
Ethan Zonca - 9 years ago 2016-10-11 23:05:33
ez@ethanzonca.com
Pulse LED instead of toggle
1 file changed with 16 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/main.c
Show inline comments
 
@@ -24,6 +24,9 @@ enum _state
 
};
 
 
static void __calc_gridloc(char *dst, double lat, double lon);
 
static void ledpulse(void);
 
 
uint32_t statled_ontime = 0;
 
 
 
int main(void)
 
@@ -51,6 +54,7 @@ int main(void)
 
    uint8_t fix_ok = 0;
 
    uint8_t numsats = 0;
 
 
 
    while (1)
 
    {
 
 
@@ -176,13 +180,24 @@ int main(void)
 
 
        if(HAL_GetTick() - led_timer > blink_rate)
 
        {
 
            HAL_GPIO_TogglePin(LED_BLUE);
 
            ledpulse();
 
            led_timer = HAL_GetTick();
 
        }
 
 
        if(statled_ontime && HAL_GetTick() - statled_ontime > 10)
 
        {
 
            HAL_GPIO_WritePin(LED_BLUE, 0);
 
            statled_ontime = 0;
 
        }
 
 
    }
 
}
 
 
static void ledpulse(void)
 
{
 
    HAL_GPIO_WritePin(LED_BLUE, 1);
 
	statled_ontime = HAL_GetTick();
 
}
 
 
static void __calc_gridloc(char *dst, double lat, double lon)
 
{
0 comments (0 inline, 0 general)