core
core copied to clipboard
Build error: assignment from incompatible pointer type
I was trying to troubleshoot an issue where SPINDLE_ENA signal (GPIO 5) was working fine, but no signal would come from SPINDLE_PWM pin (GPIO 15). My last checkout was a few months old with many settings changed, so I decided to start from a fresh build.
I get the following error when building:
/Users/du/code/ff/meg/grblhal-rp2040-2/grbl/settings.c: In function 'settings_init':
/Users/du/code/ff/meg/grblhal-rp2040-2/grbl/settings.c:3381:41: error: assignment to 'get_tool_by_idx_ptr' {aka 'tool_data_t * (*)(long unsigned int)'} from incompatible pointer type 'tool_data_t * (*)(tool_id_t)' {aka 'tool_data_t * (*)(long int)'} [-Wincompatible-pointer-types]
3381 | grbl.tool_table.get_tool_by_idx = settings_get_tool_data;
| ^
[19/151] Building C object CMakeFiles/grblHAL.dir/driver.c.o
ninja: build stopped: subcommand failed.
* The terminal process "/Users/du/.pico-sdk/ninja/v1.12.1/ninja '-C', '/Users/du/code/ff/meg/grblhal-rp2040-2/build'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
I'm using the Raspberry Pi Pico plugin for VS Code, v0.17.6. I just click the "Run Project (USB)" button.
It looks to me like a typecasting issue.