Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- volatile int led1_level; // set this variable to control the duty cycle in 2% steps
- void dim_leds() { // call this function from SysTick_Handler()
- static int cnt;
- cnt = (cnt + 1) % 50;
- if(cnt < led1_level)
- GPIOG->BSRR = 1 << 13;
- else
- GPIOG->BSRR = 1 << (13 + 16);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement