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: ad5933.cpp
- Revision:
- 8:20576c73ba85
- Parent:
- 7:0e8dabae876c
--- a/ad5933.cpp Fri Aug 20 23:27:15 2021 +0300
+++ b/ad5933.cpp Sun Aug 22 10:39:50 2021 +0300
@@ -16,6 +16,7 @@
#include "ad5933.h"
#include "mbed.h"
+#include <cstdint>
// Define Command bytes
#define INIT_FREQ 0x10 // initialise startfreq
@@ -222,8 +223,8 @@
gotoAdressPointer(0x94);
readBlock(data, 4);
- real = data[0] << 8 | data[1];
- imaginary = data[2] << 8 | data[3];
+ real = (int16_t) (data[0] << 8 | data[1]);
+ imaginary = (int16_t) (data[2] << 8 | data[3]);
return status;
}