示例#1
0
文件: irq.c 项目: kincki/contiki
/*---------------------------------------------------------------------------*/
void
irq_adc12_deactivate(const struct sensors_sensor *sensor, unsigned char adcno)
{
  /* stop converting */
  ADC12CTL0 &= ~ENC;
  /* wait for conversion to stop */
  while(ADC12CTL0 & ADC12BUSY);
  ADC12CTL0 &= ~(ADC12ON | REFON);
  ADC12IE = 0;

  /* clear any pending interrupts */
  ADC12IFG = 0;

  adcflags &= ~(1 << adcno);

  ADC12MCTL_NO(adcno) = 0;

  sethilo();

  sensors_remove_irq(sensor, IRQ_ADC);

  if(adcflags) {
    /* Turn on the ADC12 */
    ADC12CTL0 |= (ADC12ON | REFON);

    /* Delay */
    clock_delay(20000);

    /* Still active. Turn on the conversion. */
    ADC12CTL0 |= ENC | ADC12SC;
  }
}
示例#2
0
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
  BUTTON_DISABLE_IRQ();
  sensors_remove_irq(&button_sensor, BUTTON_IRQ_PORT());
}
示例#3
0
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
    PIR_DISABLE_IRQ();
    sensors_remove_irq(&pir_sensor, PIR_IRQ_PORT());
}