../src/my_driver.cpp:137:89: error: invalid conversion from 'UART_HANDLE_T {aka void*}' to 'void**' [-fpermissive] |
/* UART handle and memory for ROM API */ static UART_HANDLE_T *uartHandle; /* Use a buffer size larger than the expected return value of uart_get_mem_size() for the static UART handle type */ static uint32_t uartHandleMEM[0x10]; /* Setup UART handle and parameters */ static void setupUART() { uint32_t errCode; /* 115.2KBPS, 8N1, ASYNC mode, no errors, clock filled in later */ UART_CONFIG_T cfg = { 0,/* U_PCLK frequency in Hz */ 115200,/* Baud Rate in Hz */ 1,/* 8N1 */ 0,/* Asynchronous Mode */ NO_ERR_EN/* Enable No Errors */ }; /* Initialize UART0 */ Chip_UART_Init(LPC_USART0); Chip_Clock_SetUARTFRGDivider(1); /* Perform a sanity check on the storage allocation */ if (LPC_UARTD_API->uart_get_mem_size() > sizeof(uartHandleMEM)) { /* Example only: this should never happen and probably isn't needed for most UART code. */ errorUART(); } /* Setup the UART handle */ uartHandle = LPC_UARTD_API->uart_setup((uint32_t) LPC_USART0, (uint8_t *) &uartHandleMEM); // <---HERE IS THE ORIGINAL ERROR ... //uartHandle = LPC_UARTD_API->uart_setup((uint32_t) LPC_USART0, (uint8_t *) uartHandleMEM); // SO, FOLLOWING THE LOGIC, I TRIED THESE //uartHandle = LPC_UARTD_API->uart_setup((uint32_t) LPC_USART0, uartHandleMEM); // OTHER TWO LINES, BUT THE ERROR STILL EXISTS if (uartHandle == NULL) { errorUART(); } /* Need to tell UART ROM API function the current UART peripheral clock speed */ cfg.sys_clk_in_hz = Chip_Clock_GetSystemClockRate(); /* Initialize the UART with the configuration parameters */ errCode = LPC_UARTD_API->uart_init(uartHandle, &cfg); if (errCode != LPC_OK) { /* Some type of error handling here */ errorUART(); } } |
error: invalid conversion from 'UART_HANDLE_T {aka void*}' to 'void**' [-fpermissive] |
static uint32_t uartHandleMEM[0x10]; |
uint8_t uartHandleMEM[sizeof(uint32_t) * 16]; |
/* Setup the UART handle */ uartHandle = [color=#f00] (UART_HANDLE_T*) [/color]LPC_UARTD_API->uart_setup((uint32_t) LPC_USART0, (uint8_t *) &uartHandleMEM); |