Tool/software: Code Composer Studio
Hi,
I'm trying to use the Keyboard Widget with the Kentec LCD boosterpack (SPI version), it draws into the screen nicely and apparently it is responding to touch, but it does nothing, doesn't call any function. I've tried to search the Graphics Library User's Guide and the internet, but I can't seem to find a solution to this. How can I write something with the keyboard and pass it to a string to process? Or something like that?
The code:
#include "command/includes.h" char g_program[4]; bool g_state = false; extern tCanvasWidget g_psPanels[]; extern tCanvasWidget g_sIntroduction; extern tKeyboardWidget g_sKeyboard; void OnKeyPress(tWidget *pWidget); tCanvasWidget g_psPanels[] = { CanvasStruct(0, 0, &g_sIntroduction, &g_sKentec320x240x16_SSD2119, 0, 24, 320, 166, CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), }; Canvas(g_sHeading, &g_sIntroduction, 0, &g_sKeyboard, &g_sKentec320x240x16_SSD2119, 0, 0, 320, 23, (CANVAS_STYLE_FILL | CANVAS_STYLE_OUTLINE | CANVAS_STYLE_TEXT), ClrBlack, ClrLightGreen, ClrWhiteSmoke, g_psFontCm20, "Keyboard", 0, 0); Canvas(g_sIntroduction, g_psPanels, 0, &g_sHeading, &g_sKentec320x240x16_SSD2119, 0, 23, 320, (240 - 23), CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0); Keyboard(g_sKeyboard, &g_sHeading, 0, 0, &g_sKentec320x240x16_SSD2119, 8, 90, 300, 140, KEYBOARD_STYLE_TEXT | KEYBOARD_STYLE_FILL | KEYBOARD_STYLE_AUTO_REPEAT | KEYBOARD_STYLE_BG, ClrBlack, ClrGray, ClrDarkGray, ClrGray, ClrWhite, g_psFontCmss14, 100, 50, NUM_KEYBOARD_US_ENGLISH, g_psKeyboardUSEnglish, OnKeyPress); void OnKeyPress(tWidget *pWidget) { g_state = true; UARTprintf("Pressed any key\n\n"); snprintf(g_program, sizeof(g_program), "%s", "adc"); } int main(void) { g_SysClock = CPUClock_Set(XTAL25_W_PLL_VCO480, FREQ_120M); UART0_Init(PIOSC, FREQ_PIOSC, 921600); ROM_FPUEnable(); ROM_FPULazyStackingEnable(); ROM_IntMasterEnable(); Kentec320x240x16_SSD2119Init(g_SysClock); TouchScreenInit(g_SysClock); TouchScreenCallbackSet(WidgetPointerMessage); while(1) { WidgetAdd(WIDGET_ROOT, (tWidget *)g_psPanels); WidgetPaint(WIDGET_ROOT); while(!g_state) WidgetMessageQueueProcess(); g_state = !g_state; WidgetRemove((tWidget *)g_psPanels); CmdLineProcess(g_program); } }
Also, when I compile it gives me this warning:
"Description Resource Path Location Type #145-D a value of type "void (*)(tWidget *)" cannot be used to initialize an entity of type "void (*)(tWidget *, uint32_t, uint32_t)" Proj_Instrumentacao.c /Proj_Instrumentacao line 28 C/C++ Problem"
Thanks in advance!