Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue on idf v5.3, pointer type missmatch #66

Open
acciry opened this issue Jan 20, 2025 · 1 comment
Open

Build issue on idf v5.3, pointer type missmatch #66

acciry opened this issue Jan 20, 2025 · 1 comment

Comments

@acciry
Copy link

acciry commented Jan 20, 2025

After idf.py set-target esp32s3, and having the tools and esp-idf v5.4 installed (with prereqs, on macOS), I get the following error when building the indicator_basis example

/Users/user/path/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:51:24: error: initialization of 'esp_err_t (*)(uint8_t *)' {aka 'int (*)(unsigned char *)'} from incompatible pointer type 'esp_err_t (*)(uint16_t *)' {aka 'int (*)(short unsigned int *)'} [-Wincompatible-pointer-types]
   51 |     .read_input_pins = tca9535_read_input_pins,
      |                        ^~~~~~~~~~~~~~~~~~~~~~~
/Users/user/path/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:51:24: note: (near initialization for 'g_board_lcd_evb_io_expander_ops.read_input_pins')
@acciry acciry changed the title Build issue on idf v5.3, Build issue on idf v5.3, pointer type missmatch Jan 20, 2025
@tonyleo723
Copy link

It looks like the parameters of tca9535_read_input_pins(defined in components/i2c_devices/io_expander/tca9535.c) functions don't match the definition of io_expander_ops_t(defined in components/bsp/include/bsp_board.h)

I think this function is used to read the status register of the tca9535's input pins. tca9535 provides 16 input pins so it should be a 16-bit output.

Referring to the following modification of bsp_board.h may solve the problem

esp_err_t (*read_input_pins)(uint8_t *pin_val); //at line 200 of bsp_board.h
//change to
esp_err_t (*read_input_pins)(uint16_t *pin_val); //at line 200 of bsp_board.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants