diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2022-04-12 11:50:14 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2022-04-12 11:54:56 +0200 |
commit | 2041e7badf28e54c3b999dde1ecfed86e2769656 (patch) | |
tree | 520cdf8e7b89763c30ae5850883d338a4e10b124 /src/app/main.c | |
parent | d5ed0e4b6d59ae2800b65823a1abe6338c5ea6e2 (diff) | |
download | ADF4002_27MHz_PLL-2041e7badf28e54c3b999dde1ecfed86e2769656.tar.gz ADF4002_27MHz_PLL-2041e7badf28e54c3b999dde1ecfed86e2769656.tar.bz2 ADF4002_27MHz_PLL-2041e7badf28e54c3b999dde1ecfed86e2769656.zip |
Add STATUS LED
Diffstat (limited to 'src/app/main.c')
-rw-r--r-- | src/app/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/app/main.c b/src/app/main.c index 6fe7cd7..5b35286 100644 --- a/src/app/main.c +++ b/src/app/main.c @@ -6,6 +6,7 @@ /* Definitions for pins */ #define PORTB_PLL_MUXOUT (1 << 0) +#define PORTB_LED_STATUS (1 << 1) #define PORTB_PLL_LE (1 << 4) #define PORTB_PLL_DATA (1 << 3) #define PORTB_PLL_CLK (1 << 2) @@ -74,8 +75,8 @@ int main(void) seconds = 0; /* Configure GPIO */ - PORTB = PORTB_PLL_LE; - DDRB = PORTB_PLL_CLK | PORTB_PLL_LE | PORTB_PLL_DATA; + PORTB = PORTB_PLL_LE | PORTB_LED_STATUS; + DDRB = PORTB_PLL_CLK | PORTB_PLL_LE | PORTB_PLL_DATA | PORTB_LED_STATUS; /* initialise timer interrupt */ inittimer(); @@ -105,15 +106,15 @@ int main(void) while (1) { /* - // We actually dont use the timer, but the code is kept around as a reference. const uint32_t second = seconds % 60uL; const uint32_t minute = seconds / 60uL; - if ((PINB & PORTB_PLL_MUXOUT) == 0) { delay_ms(600); } */ - delay_ms(1000); + delay_ms(200); + + set_pin(PORTB_LED_STATUS, seconds % 4 < 2); } return 0; |