Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: HbMotor.cpp
- Revision:
- 48:71aec693a7dc
- Parent:
- 46:5074781a28dd
- Child:
- 60:8ed7b7f0c371
--- a/HbMotor.cpp Wed Feb 20 12:54:25 2019 +0000 +++ b/HbMotor.cpp Sun Feb 24 10:33:34 2019 +0000 @@ -161,12 +161,27 @@ val = tmpVal; } + // iVal = ofs + attval + val; + // UCHAR uPos = pos * 2 + typ; + + // if(gf_Print.d2.bf.mrpm){ + // sp.printf("POS[%d] Val[%d] ", uPos, iVal); + // } + + // fpgaMotor(uPos, calcPwm(iVal)); +} + +void HbMotCtrl::setRpmValue(){ + INT16 iVal = 0; iVal = ofs + attval + val; UCHAR uPos = pos * 2 + typ; - + + if(gf_Print.d2.bf.mrpm){ + sp.printf("P%d V:%d ", uPos, iVal); + } + fpgaMotor(uPos, calcPwm(iVal)); } - INT16 HbMotCtrl::getRpmValue(eMotInType type){ if(OFS == type){ return ofs; @@ -253,6 +268,12 @@ motCtrl[1]->setRpmValue(type, val); } +void HbSubProp::setValue(){ + if(motCtrl[0] == NULL || motCtrl[1] == NULL) return; + motCtrl[0]->setRpmValue(); + motCtrl[1]->setRpmValue(); +} + INT16 HbSubProp::getValue(eMotInType type){ if(motCtrl[0] == NULL || motCtrl[1] == NULL) return 0; // 同じはずなのでINのみ