analogdevicesinc / no-OS

Software drivers in C for systems without an operating system
http://analogdevicesinc.github.io/no-OS/
Other
924 stars 1.65k forks source link

ADuCM3029 platform timer implementation bug #2169

Closed LehMaxence closed 5 months ago

LehMaxence commented 5 months ago

In the aducm3029_timer_init function signature, the second parameter must be a const pointer to adhere to the no_os_timer_platform_ops struct init field signature:

https://github.com/analogdevicesinc/no-OS/blob/4cb1ed065a517c0c33e728b1620b017783e67bb7/drivers/platform/aducm3029/aducm3029_timer.c#L111

https://github.com/analogdevicesinc/no-OS/blob/4cb1ed065a517c0c33e728b1620b017783e67bb7/drivers/platform/aducm3029/aducm3029_timer.c#L441

https://github.com/analogdevicesinc/no-OS/blob/4cb1ed065a517c0c33e728b1620b017783e67bb7/include/no_os_timer.h#L110

Here's the error from IAR:

        .init = &aducm3029_timer_init,
                ^
"aducm3029_timer.c",441  Error[Pe144]:
          a value of type "int32_t (*)(struct no_os_timer_desc **, struct
          no_os_timer_init_param *)" cannot be used to initialize an entity of
          type "int32_t (*)(struct no_os_timer_desc **, struct
          no_os_timer_init_param const *)"
rbolboac commented 5 months ago

Hi @LehMaxence , Thank you for reporting this. We merged the following fix https://github.com/analogdevicesinc/no-OS/pull/2175 . Let us know if you encounter any other issues.

Ramona