Hi Nick,
I can see that you are not on the nxp staff and may not have the time to answer this, but I am writing this in hopes that you can.
In your response to my question about both LEDs turning on, you suggested I adapt the SDK function to accomplish the task. Well, I tried that by taking the original code that works and adding lines of code that I think should be there for the red led. The original code works just fine. The seven lines of code that I added are commented out using the form of " //***** " ahead of the line of non-functional code so that they are more easily spotted. Additionally, I added information to the ConfigTools (pins) for the red led as:
L14 GPIO_AD_26 , etc..
My question is... can you take a quick look at my seven lines of added code and tell me where I am going astray? I would really appreciate any help you can offer.
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_gpio.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define EXAMPLE_LED_GPIO BOARD_USER_LED_GPIO
#define EXAMPLE_LED_GPIO_PIN BOARD_USER_LED_GPIO_PIN
//******#define EXAMPLE_REDLED_GPIO BOARD_USER_REDLED_GPIO
//******#define EXAMPLE_REDLED_GPIO_PIN BOARD_USER_REDLED_GPIO_PIN
/*******************************************************************************
* Prototypes
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
/* The PIN status */
volatile bool g_pinSet = false;
/*******************************************************************************
* Code
******************************************************************************/
/*!
* @brief Main function
*/
int main(void)
{
/* Define the init structure for the output LED pin*/
gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};
//****** gpio_redpin_config_t pinL14_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};
/* Board pin, clock, debug console init */
BOARD_ConfigMPU();
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
/* Print a note to terminal. */
PRINTF("\r\n GPIO Driver example\r\n");
PRINTF("\r\n The LED is blinking.\r\n");
/* Init output LED GPIO. */
GPIO_PinInit(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, &led_config);
//****** GPIO_PinInit(EXAMPLE_REDLED_GPIO, EXAMPLE_REDLED_GPIO_PIN, gpio_redpin_config_t );
while (1)
{
SDK_DelayAtLeastUs(100000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);
#if (defined(FSL_FEATURE_IGPIO_HAS_DR_TOGGLE) && (FSL_FEATURE_IGPIO_HAS_DR_TOGGLE == 1))
GPIO_PortToggle(EXAMPLE_LED_GPIO, 1u << EXAMPLE_LED_GPIO_PIN);
//****** GPIO_PortToggle(EXAMPLE_REDLED_GPIO, 1u << EXAMPLE_REDLED_GPIO_PIN);
#else
if (g_pinSet)
{
GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 0U);
//****** GPIO_PinWrite(EXAMPLE_REDLED_GPIO, EXAMPLE_REDLED_GPIO_PIN, 0U);
g_pinSet = false;
}
else
{
GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 1U);
//****** GPIO_PinWrite(EXAMPLE_REDLED_GPIO, EXAMPLE_REDLED_GPIO_PIN, 1U);
g_pinSet = true;
}
#endif /* FSL_FEATURE_IGPIO_HAS_DR_TOGGLE */