Exemplo n.º 1
0
void error_init(void)
{
  count = 0;
  toggle = 0;
  delay = 0;
  led_red_off();
}
Exemplo n.º 2
0
void hal_clocksource_init(void){
    //for debugging clocksource problems
    led_red_on();
    led_green_on();

    //power up osc (?)
    SLEEP &= ~CLOCKSOURCE_OSC_PD_BIT;
    //wait for XOSC stable
    while(!CLOCKSOURCE_XOSC_STABLE()){}
    NOP();

    //start crystal osc as HS clocksource, OSC32 is int rc osc
    CLKCON = 0x80;

    //wait for selection to be active
    while(!CLOCKSOURCE_XOSC_STABLE()){}
    NOP();

    //power down the unused oscillator
    SLEEP |= CLOCKSOURCE_OSC_PD_BIT;


    //for debugging clocksource problems
    led_red_off();
    led_green_off();
}
Exemplo n.º 3
0
void
led_red_blink(int ms)
{
    led_red_on();
    stall(ms);
    led_red_off();
    stall(ms);
}
Exemplo n.º 4
0
Arquivo: led.c Projeto: nesl/sos-2x
int8_t ker_led(uint8_t action)
{
  switch (action){
  case LED_RED_ON:        led_red_on();        break;
  case LED_GREEN_ON:      led_green_on();      break;
  case LED_YELLOW_ON:     led_yellow_on();     break;
  case LED_RED_OFF:       led_red_off();       break;
  case LED_GREEN_OFF:     led_green_off();     break;
  case LED_YELLOW_OFF:    led_yellow_off();    break;
  case LED_RED_TOGGLE:    led_red_toggle();    break;
  case LED_GREEN_TOGGLE:  led_green_toggle();  break;
  case LED_YELLOW_TOGGLE: led_yellow_toggle(); break;
  }
  return 0;
}
Exemplo n.º 5
0
void error_worker(void)
{
  if(count > 0) {
    if(delay == 0) {
      toggle = 1 - toggle;
      if(toggle) {
        led_red_on();
      } else {
        led_red_off();
        count--;
      }
      delay = ERROR_SPEED;
    } else {
      delay--;
    }
  }
}
Exemplo n.º 6
0
void show_boot_progress(int status)
{
	printf ("Status: %d\n", status);
        led_red_off();
	led_blue_off();

	if (status < -2 ) {
		led_red_on();
		return;
	}
	switch(status){
		case -1: /* Image Header has bad magic number */
			led_red_on();
			break;
						
                case 1:
                        break;
                case 2:
                        break;
                case 3:
                        break;
                case 4:
                        break;
                case 5:
                case 6:
                        break;
                case 7:
                case 8:	/* Image Type check ok */
			led_blue_on();
                        break;
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15: /* All preparation done, transferring control to OS */
			led_blue_on();
                        break;
                default:
                        break;
        }
}
Exemplo n.º 7
0
static void sfi_err_code_led_display(uint8_t errcode)
{
  uint8_t _led_display;				
  _led_display = errcode;				
  if (_led_display & 0x01)			
    led_yellow_on();				
  else					
    led_yellow_off();				
  _led_display >>= 1;				
  if (_led_display & 0x01)			
    led_green_on();				
  else					
    led_green_off();				
  _led_display >>= 1;				
  if (_led_display & 0x01)			
    led_red_on();				
  else					
    led_red_off();
  return;
}
Exemplo n.º 8
0
// Definitions
// ------------------------------------
// Fonction permettant d'initialiser les leds
// ------------------------------------
void led_init(void)
{
   P1DIR |= LEDG | LEDR;        // bits 0 et 7 du port 1 sont des sorties
   led_green_off();
   led_red_off();
}