core icon indicating copy to clipboard operation
core copied to clipboard

Build error when AUX_CONTROLS_ENABLED

Open dresco opened this issue 1 year ago • 2 comments

Following latest core update. It seems drivers are expecting pin_mode_t.claimable, but this doesn't exist in the struct..

#if AUX_CONTROLS_ENABLED
    for(i = AuxCtrl_ProbeDisconnect; i < AuxCtrl_NumEntries; i++) {
        if(aux_ctrl[i].enabled) {
            if((aux_ctrl[i].enabled = ioports_enumerate(Port_Digital, Port_Input, (pin_mode_t){ .irq_mode = aux_ctrl[i].irq_mode, .claimable = On }, aux_claim, (void *)&aux_ctrl[i])))
                hal.signals_cap.mask |= aux_ctrl[i].cap.mask;
        }
    }
#endif
typedef union {
    uint16_t mask;
    struct {
        uint16_t input      :1,
                 output     :1,
                 open_drain :1,
                 pull_mode  :2,
                 irq_mode   :5,
                 analog     :1,
                 pwm        :1,
                 servo_pwm  :1,
                 claimed    :1,
                 reserved   :2;
    };
} pin_mode_t;

dresco avatar Jan 24 '24 10:01 dresco

Change:

if((aux_ctrl[i].enabled = ioports_enumerate(Port_Digital, Port_Input, (pin_mode_t){ .irq_mode = aux_ctrl[i].irq_mode, .claimable = On }, aux_claim, (void *)&aux_ctrl[i])))

to: if((aux_ctrl[i].enabled = ioports_enumerate(Port_Digital, Port_Input, (pin_cap_t){ .irq_mode = aux_ctrl[i].irq_mode, .claimable = On }, aux_claim, (void *)&aux_ctrl[i])))

pin_cap_t is new, added to get rid of some ambiguity in earlier code. FYI there are some further changes coming to the ioports code in order to make it more complete and flexible, including a $-command to output low-level info about aux pins. Hopefully that will be the end of the recent spate of changes to the core/HAL APIs...

terjeio avatar Jan 24 '24 10:01 terjeio

Thanks!

dresco avatar Jan 24 '24 11:01 dresco