AnsweredAssumed Answered

kdsk - how to access hardware, say GPIO, inside and outside interrupts?

Question asked by Peter O on Jan 19, 2017
Latest reply on Jan 24, 2017 by xiangjun.rong

Using ksdk on a Cortex M4. Using kdsk if your accessing hardware from inside and outside interrupts do you need to add disable and enable interrupts around the hardware access in the main thread?  see //### below

 

Like this:
void main(void)
{
  GPIO_PinInit();   //init some kdsk hardware
  enableInterruptXYZ();
  while (1)
  {
    disableInterruptXYZ();  //### need this line?
    GPIO_WritePinOutput(); //access some kdsk hardware
    enableInterruptXYZ();  //### also need this line?
    //do other stuff
  }
}

 

InterruptXYZ-Handler()
{
GPIO_WritePinOutput(); //access the same kdsk hardware
}

Outcomes