Ejemplo n.º 1
0
 * value is the same as the value in OCR1A
 */
void init_timer(void)
{
  timer_interrupt = false;
  TCCR1A = 0x00;                // TCCR is Timer Counter Control Register
  TCCR1B = 0x0D;
  OCR1A = TIMER_INTERRUPT_RATE; // Set timer interrupt rate
  TIMSK1 |= (1<<OCIE1A);        // Enable timer interrupt
}

/**
 * @brief interrupt handler for TIMER1_COMPA_vect
 * @return Void
 */
ISR(_VECTOR(11)){
  timer_interrupt = true;
};

/**
 * @brief routine executed on timer interrupt (during main loop)
 * @return Void
 */
void timer_routine(void)
{
  int i = 0;

  timer_interrupt = false;

  // Toggle LEDs to show action
  if(!led_toggle)
Ejemplo n.º 2
0
clock_seconds(void)
{
  unsigned long tmp;
  do {
    tmp = seconds;
  } while(tmp != seconds);
  return tmp;
}

#ifdef HANG_ON_UNKNOWN_INTERRUPT
/* Useful for diagnosing unknown interrupts that reset the mcu.
 * Currently set up for 12mega128rfa1.
 * For other mcus, enable all and then disable the conflicts.
 */
static volatile uint8_t x;
ISR( _VECTOR(0)) {while (1) x++;}
ISR( _VECTOR(1)) {while (1) x++;}
ISR( _VECTOR(2)) {while (1) x++;}
ISR( _VECTOR(3)) {while (1) x++;}
ISR( _VECTOR(4)) {while (1) x++;}
ISR( _VECTOR(5)) {while (1) x++;}
ISR( _VECTOR(6)) {while (1) x++;}
ISR( _VECTOR(7)) {while (1) x++;}
ISR( _VECTOR(8)) {while (1) x++;}
ISR( _VECTOR(9)) {while (1) x++;}
ISR( _VECTOR(10)) {while (1) x++;}
ISR( _VECTOR(11)) {while (1) x++;}
ISR( _VECTOR(12)) {while (1) x++;}
ISR( _VECTOR(13)) {while (1) x++;}
ISR( _VECTOR(14)) {while (1) x++;}
ISR( _VECTOR(15)) {while (1) x++;}
Ejemplo n.º 3
0
{
  int i = 0;
  int j = 0;

  for(i = 0; i < 100; i++){
    for(j = 0; j < 100; j++){
    }
  }
  return;
}

/**
 * @brief interrupt handler 
 * @TODO - NEED TO FIGURE OUT WHAT INTERRUPT
 */
ISR(_VECTOR(20)){
  transmit_complete = true;
  set_stat_led2(true);
}

/**
 * @brief The primary user interface's main routine.
 * @return void, but should never return
 * @bug "delay" call between sending enter and the cell.
 * @warning Is it necessary to send the entire cell with
 * the enter, since we have already sent the dots that
 * make up that cell? This work could be done by the
 * main board instead.
 *
 * Initializes the system. Interrupt handlers are set to
 * flip bools if data has been (sent to? or) received from