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: Gamepad2/Gamepad.cpp
- Revision:
- 3:b7df72682b81
- Parent:
- 2:07cef563acdf
- Child:
- 4:9b7ea5528a5c
--- a/Gamepad2/Gamepad.cpp Mon Mar 30 15:03:36 2020 +0000
+++ b/Gamepad2/Gamepad.cpp Wed Apr 01 16:25:32 2020 +0000
@@ -414,12 +414,10 @@
dac->write(val);
}
-//writes DAC value in int format
-void Gamepad::write_u16(int val)
+//writes DAC value in uint format
+void Gamepad::write_u16(unsigned short val)
{
- if (val < 0) {
- val = 0;
- } else if (val > 65535) {
+ if (val > 65535) {
val = 65535;
}
dac->write_u16(val);