Skip to content

Conversation

@askuric
Copy link
Member

@askuric askuric commented Jun 22, 2024

Ok so this is the final pull request that unifies all the changes necessary for the API transition from v2.x to v3.x arduino-esp32.

Main changes:

  • MCWPM driver rewritten completely
    • made more flexible, no more slots
  • Low-side current sensing rewritten completely for the new API
    • new timer synchronization code
    • made more flexible, no more hard-coded funcitons and variables
    • could support more than 2 motors (but not suggested - adc read time too long)
  • ADC fast reading rewritten
    • simplified both for esp32 and esp32s variants
    • Now used by default both for mcwpm and ledc
  • LEDC driver rewritten for the new API
    • Extended and made more flexible
    • now center aligned
    • now supports 6pwm
  • More elaborate error reporting and debugging scheme, easier to know what went wrong

Other new features:

  • I've also mad the function _driverSyncLowSide return -1 if it fails, so there are a few slight changes other mcu types, not just esp32
  • I've made the functions _configureLowSide and _readADCVolatgeLowSide return -1 (and display a debugging error) by default instead of calling their inline equivalents. This is a safety measure to avoid using suing low-side current sensing if it's not available.
    • this required a slight change in the BG431 driver

The code was tested on esp32 and esp32s3 variants, so it is relatively mature.
It needs much more testing, but I think that it should be fine for the dev branch.

@askuric
Copy link
Member Author

askuric commented Jun 23, 2024

We're going for the merge! 🎉 :D

@askuric askuric merged commit 538e59d into dev Jun 23, 2024
@askuric askuric deleted the 408-feature-support-for-arduino-esp32-v301-current_sensing branch June 23, 2024 08:17
@askuric askuric added this to the 2.3.4_Release milestone Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants