i am new to c++ or freertos but i am trying to only use 1 pin to power an external led but i get the error
expected primary-expression before ',' token
GPIO_PinWrite(led, led_pin, 0u)
i also get this ^^ with the other pin write
this was fixed by deleting the semicoloms behind the define
i don't specificaly know how to make an gpio pinWrite but i copied the one that is in the example of the baremetal function.
this is my task i am using an imxrt1050-evkb
**this is standard import by MCUXpresso**
#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MIMXRT1052.h"
#include "fsl_debug_console.h"
**this is freeRTOS**
#include "FreeRTOSConfig.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#define led SEMC_D12;
#define led_pin GPIO_EMC_34;
volatile bool g_pinSet = false;
void vOnOff(void *pvParameters)
{
while(true){
vTaskDelay(200);
PRINTF("Hello led\n");
if(g_pinSet)
{
GPIO_PinWrite(led, led_pin, 1u);
g_pinSet = true;
}
else
{
GPIO_PinWrite(led, led_pin, 0u);
g_pinSet = false;
}
}
}
int main(void) {
gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};
/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
/* Init FSL debug console. */
BOARD_InitDebugConsole();
// GPIO_PinInit(led , led_pin , &led_config);
xTaskCreate(
(TaskFunction_t) vOnOff,
"task3",
configMINIMAL_STACK_SIZE,
NULL,
10,
NULL
);
vTaskStartScheduler();
return 0 ;
}
i believe the code here ^^ is all the good i use for this example becouse i am working in an sandbox with spaghetti code everywhere
as you can see in my code i got GPIO_PinInit commented i don't know if i need to use that?
i expect to send an signal on and of to an io pin