Tool/software: Code Composer Studio
I am working on CCS7. I have a EK-TM4C1294XL.
I made a new project by copying enet_io and renaming it.
To this project I wanted to add an LED on PF1. Looking at the code I concluded I needed to configure the pin as an output similar to how a port N pint was confired as output in the file drivers/pinout.c.
Right after the existing code on line 170 as follows:
// Default the LEDs to OFF. // ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0 | GPIO_PIN_1, 0);
I made the following change to add new code to the file and saved it.
// // Set PF1 for GIPO Output and high. // //GPIODirModeSet(uint32_t ui32Port,uint8_t ui8Pins,uint32_t ui32PinIO) //GPIODirModeSet(GPIO_PORTF_BASE,GPIO_PIN_1,GPIO_DIR_MODE_OUT) // Wait for the GPIO F to come out of reset. // while(!MAP_SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF)) { } // MAP_GPIODirModeSet(GPIO_PORTF_BASE,GPIO_PIN_1,GPIO_DIR_MODE_OUT); // GPIOPinConfigure(GPIO_PF1_EN0LED2); // FLE on 20180626 ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1); MAP_GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_1,GPIO_STRENGTH_12MA, GPIO_PIN_TYPE_STD); //Lets send it high. ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_PIN_1 ); //Lets send it low. ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 5); //Lets send it high. ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_PIN_1 );
When I open the pinout.c file in the original enot_io project my changes are in it too.
How was I to know this would happen? What is this file behavior called and where should I read about it.
Is there documentation to tell me how I should go about writing code that does not have unexpected shared files with outer projects and for example mess up the examples?