Advertisement
teplofizik

test.c (flash)

Jun 7th, 2013
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. // ***********************************************************
  2. //  test.c
  3. //
  4. // ***********************************************************
  5.  
  6. #include "test.h"
  7. #include "../drivers.h"
  8. #include "../bsp.h"
  9.  
  10. static void test_onTimer(void)
  11. {
  12.     static bool State = false;
  13.    
  14.     if(Settings.Value1)
  15.     {
  16.         led_On(1);
  17.     }
  18.     else
  19.     {
  20.         led_Off(1);
  21.     }
  22.        
  23.     if(State)
  24.     {
  25.         led_On(0);
  26.     }
  27.     else
  28.     {
  29.         led_Off(0);
  30.     }
  31.    
  32.     State = !State;
  33. }
  34.  
  35. void test_ResetSettings(void)
  36. {
  37.     Settings.Value1 = false;
  38. }
  39.  
  40. static void onButton(uint8_t Button)
  41. {
  42.     Settings.Value1 = !Settings.Value1;
  43.     settings_Save();
  44. }
  45.  
  46. void test_Init(void)
  47. {
  48.     timer_AddFunction(2, &test_onTimer);
  49.     button_SetHandler(&onButton);
  50. }
  51.  
  52. void test_Main(void)
  53. {
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement