Tool/software: Code Composer Studio
Hi.,
I downloaded a cJSON file from Github and included that in my program (CCS IDE )for GUI interface., but I couldn't able to see any output in my program it is showing some warning and I couldn't able to proceed further., please help me with this I am pretty new to programming.
Launchpad: EK -TM4C123GXL
PROGRAM:
// blinky.c - Simple example to blink the on-board LED.
// This is part of revision 2.1.4.178 of the EK-TM4C123GXL Firmware Package.
//*****************************************************************************
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "cJSON.h"
//*****************************************************************************
#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
while(1);
}
#endif
//*****************************************************************************
void printled_statewithjson(uint32_t ui32Loop){
cJSON *root = cJSON_CreateObject();
if (root == NULL) {
return;
}
cJSON_AddItemToObject(root, "GPIOPinWrite", cJSON_CreateNumber(ui32Loop));
char *string = cJSON_Print(root);
if (string == NULL) {
fprintf(stderr, "Failed to print monitor.\n");
}
end:
cJSON_Delete(root);
return string;
}
int main(void)
{
uint32_t ui32Loop;
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF))
{
}
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3);
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, ui32Loop);
while(1)
{
// Turn on the LED.
printled_statewithjson(GPIO_PIN_3);
// Delay for a bit.
SysCtlDelay(200000);
// Turn off the LED.
printled_statewithjson(0x0);
// Delay for a bit.
SysCtlDelay(200000);
}
}