designator order for field 'xxx' does not match declaration order in 'yyy'

This error occurs when the "order of declared members" is not in the right order.
I don't know the rules of this language enough, but it would appear there is a fixed order when you do an inline declaration:

 

This is correct, for example:

camera_config_t config =  {
    .pin_pwdn = PWDN_GPIO_NUM,
    .pin_reset = RESET_GPIO_NUM,
    .pin_xclk = XCLK_GPIO_NUM,
....

 

While this one (reset and pwdn are reversed) generates the error:

 

camera_config_t config =  {
    .pin_reset = RESET_GPIO_NUM,
    .pin_pwdn = PWDN_GPIO_NUM,
    .pin_xclk = XCLK_GPIO_NUM,
    ....
    

Revision #1
Created 25 September 2024 06:01:24 by Tim
Updated 25 September 2024 06:05:06 by Tim