• Ok, so it's not DAC you want, just PWM?

    Would it be an option to have func and pin in UtilTimerTaskBuffer instead of a union ?

    Not really - it's just more memory usage, and it's taking code that works for all platforms and then adding loads of platform-specific definitions to it.

    Just do something like:

    JshPinFunction pinToPinFunction(Pin x) {
      return JSH_TIMER1 + ((x>>4)<<JSH_SHIFT_TYPE) + ((x&15)<<JSH_SHIFT_INFO);
    }
    
    Pin pinFunctionToPin(JshPinFunction x) {
      return (((x-JSH_TIMER1)>>JSH_SHIFT_TYPE)<<4) + (x>>JSH_SHIFT_INFO);
    }
    
About

Avatar for Gordon @Gordon started