Closed Candas1 closed 1 year ago
Probably adding this in LowsideCurrentSense.cpp should be good enough:
#include "./communication/SimpleFOCDebug.h
.......
if (!driver){
SIMPLEFOC_DEBUG("MOT: Align current sense not possible, driver not initialized.");
return 0;
}
Results:
MOT: Align current sense.
MOT: Align current sense not possible, driver not initialized.
MOT: Align error!
MOT: Init FOC failed.
I can create a pull request if you are ok.
Forget it, with STM32 the current sense init fails so it's ok
current_sense.init() failed.
So probably something missing in my GD32 implementation.
@runger1101001 it seems this could be useful afterall.
Is your feature request related to a problem? Please describe. If you forget to link the driver to current sense (what I just did ah ah )
current_sense.linkDriver(&driver);
This takes you to the default handler infinite loop.Describe the solution you'd like Could be worth checking if the driver is linked, drop a debug message and return.
Additional context Simplefoc is very well documented but this kind of things happens, and can generate unnecessary discussions in the forum.