root/platform/ixus80_sd1100/leds.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. blink_it

   1 /*
   2  * this file is part of the chdk project
   3  * (c) 2008 chr
   4  * GPL v3+
   5  */
   6 
   7 #include "platform.h"
   8 #include "leds.h"
   9 
  10 
  11 void blink_it(volatile long *p) {
  12     int counter;
  13 
  14         asm("stmdb      sp!, {r0, r1, r2, r3} \n"); \
  15 
  16     counter = DELAY; *p = 0x46;
  17     while (counter--) { asm("nop\n nop\n"); };
  18     counter = DELAY; *p = 0x44;
  19     while (counter--) { asm("nop\n nop\n"); };
  20 
  21         asm("ldmia      sp!, {r0, r1, r2, r3} \n"); \
  22 }
  23 
  24 #define blink_(LED) void blink_##LED() { \
  25         blink_it((long*)LED); \
  26 } \
  27 void __attribute__((noinline)) LED##_ON() { \
  28         *(long *)LED = 0x46; \
  29 } \
  30 void __attribute__((noinline)) LED##_OFF() { \
  31         *(long *)LED = 0x44; \
  32 }
  33 blink_(LED_PWR)
  34 blink_(LED_GREEN)
  35 blink_(LED_YELLOW)
  36 blink_(LED_ORANGE)
  37 blink_(LED_AF)
  38 blink_(LED_PR)
  39 
  40 #undef blink_
  41 

/* [<][>][^][v][top][bottom][index][help] */