While trying to get the analog comparator on a TM4C123GH6PM working I also tried PinMux 1.0.4 at some point in time. I didn't post that in the other thread http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/350179/1228037.aspx to not convolute that thread. But I think it deserves a mention. And not an honorable one.
Here is the output of what PinMux 1.0.4 generates as code to initiate comparator 1:
void PortFunctionInit(void) { // // Enable Peripheral Clocks // MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_COMP1); MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // // Enable pin PC5 for COMP1 C1+ // MAP_GPIOPinConfigure(GPIO_PC5_C1+); MAP_GPIOPinTypeComparator(GPIO_PORTC_BASE, GPIO_PIN_5); // // Enable pin PF1 for COMP1 C1O // MAP_GPIOPinConfigure(GPIO_PF1_C1O); MAP_GPIOPinTypeComparator(GPIO_PORTF_BASE, GPIO_PIN_1); // // Enable pin PC4 for COMP1 C1- // MAP_GPIOPinConfigure(GPIO_PC4_C1-); MAP_GPIOPinTypeComparator(GPIO_PORTC_BASE, GPIO_PIN_4); }
Of the nine lines of code at least four are wrong! 44%, and that is not counting what is missing. I mean, seriously? Is that supposed to be a professional tool?
One doesn't even need to try to compile it. Any mediocre C programmer immediately recognizes this. How could that PinMux tool manage to escape into the wild?