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.
Dependents: qonly_controller foc-ed_in_the_bot_compact foc-ed_in_the_bot_compact CurrentModeSine ... more
Fork of FastPWM by
Revision 2:4b8de6ae5885, committed 2012-07-12
- Comitter:
- Sissors
- Date:
- Thu Jul 12 19:26:43 2012 +0000
- Parent:
- 1:1aed61747ed6
- Child:
- 3:3094d3806cfc
- Commit message:
- ms and us functions were multiplying by 1k(k) instead of dividing
Changed in this revision
| FastPWM.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/FastPWM.cpp Thu Jul 12 11:23:31 2012 +0000
+++ b/FastPWM.cpp Thu Jul 12 19:26:43 2012 +0000
@@ -28,15 +28,15 @@
}
void FastPWM::period_ms(int ms) {
- period((double)ms*1000.0);
+ period((double)ms/1000.0);
}
void FastPWM::period_us(int us) {
- period((double)us*1000000.0);
+ period((double)us/1000000.0);
}
void FastPWM::period_us(double us) {
- period(us*1000000.0);
+ period(us/1000000.0);
}
void FastPWM::pulsewidth(double seconds) {
@@ -44,15 +44,15 @@
}
void FastPWM::pulsewidth_ms(int ms) {
- pulsewidth((double)ms*1000.0);
+ pulsewidth((double)ms/1000.0);
}
void FastPWM::pulsewidth_us(int us) {
- pulsewidth((double)us*1000000.0);
+ pulsewidth((double)us/1000000.0);
}
void FastPWM::pulsewidth_us(double us) {
- pulsewidth(us*1000000.0);
+ pulsewidth(us/1000000.0);
}
void FastPWM::write(double duty) {
