Advertisement
MagnusArias

SW | Mryganie

Apr 20th, 2016
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.16 KB | None | 0 0
  1. #define PB_OER ((volatile unsigned int*) (0xFFFFF400+0x0010))
  2. #define PB_PER ((volatile unsigned int*) (0xFFFFF400+0x0000))
  3. #define PB_MDER ((volatile unsigned int*) (0xFFFFF400+0x0050))
  4. #define PB_SODR ((volatile unsigned int*) (0xFFFFF400+0x0030))
  5. #define PB_CODR ((volatile unsigned int*) (0xFFFFF400+0x0034))
  6.  
  7. #define PC_OER ((volatile unsigned int*) (0xFFFFF600+0x0010))
  8. #define PC_PER ((volatile unsigned int*) (0xFFFFF600+0x0000))
  9. #define PC_MDER ((volatile unsigned int*) (0xFFFFF600+0x0050))
  10. #define PC_SODR ((volatile unsigned int*) (0xFFFFF600+0x0030))
  11. #define PC_CODR ((volatile unsigned int*) (0xFFFFF600+0x0034))
  12.  
  13. #define LED_DS1 8
  14. #define LED_DS2 29
  15.  
  16. void dbgu_print_ascii(){}
  17.  
  18. int main(void){
  19.     volatile int i = 0;
  20.     volatile int j = 0;
  21.    
  22.     *PB_OER = (1<<LED_DS1);
  23.     *PB_PER = (1<<LED_DS1);
  24.     *PB_MDER = (0<<LED_DS1);
  25.    
  26.     *PC_OER = (1<<LED_DS2);
  27.     *PC_PER = (1<<LED_DS2);
  28.     *PC_MDER = (0<<LED_DS2);
  29.    
  30.     while(1){
  31.         while (j <= 300000) {j++;}
  32.         *PB_SODR = (1<<LED_DS1); // gasi
  33.         *PC_CODR = (1<<LED_DS2); // zapala
  34.         while (i <= 300000){ i++;}
  35.         *PB_CODR = (1<<LED_DS1); // zapala
  36.         *PC_SODR = (1<<LED_DS2); // gasi
  37.         j = 0;
  38.         i = 0;
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement