Petr Kubiznak

MQX 4.1.1 init_gpio.c potential bug

Discussion created by Petr Kubiznak on Sep 8, 2014
Latest reply on Sep 8, 2014 by Kenny Koller

Hi,

MQX 4.1.1 brings the following patch to the file mqx/source/bsp/twrk70f120m/init_gpio.c:

 

@@ -811,7 +811,11 @@

 

             pctl->PCR[18] = PORT_PCR_MUX(4) | PORT_PCR_ODE_MASK;

             pctl->PCR[19] = PORT_PCR_MUX(4) | PORT_PCR_ODE_MASK;

-

+            /* Enable SDA rising edge detection */

+#if BSPCFG_ENABLE_LEGACY_II2C_SLAVE

+            pctl->PCR[18] |= PORT_PCR_IRQC(0x09);

+            pctl->PCR[18] |= PORT_PCR_ISF_MASK;

+#endif

             sim->SCGC4 |= SIM_SCGC4_IIC0_MASK ;

 

             break;

 

That visually seems to me like a potential bug, even though I have not examined it thoroughly. But as there are two lines in the conditioned block, I think it was meant to configure pins 18 and 19, not twice the same pin 18. Please correct me if I am wrong.

Outcomes