You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
395 B

  1. #ifndef LED_H
  2. #define LED_H
  3. #include "config.h"
  4. #define LED_BLINK_RATE 8
  5. extern int16_t __led_pattern;
  6. /* Initialize LED */
  7. void led_init(void);
  8. /* Set a pattern (8-bit binary pattern). */
  9. void led_pattern(uint8_t pattern);
  10. static inline void led_on(void)
  11. {
  12. __led_pattern = -1;
  13. PORTBbits.RB13 = 0;
  14. }
  15. static inline void led_off(void)
  16. {
  17. __led_pattern = -1;
  18. PORTBbits.RB13 = 1;
  19. }
  20. #endif