mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
ldt0028: Removed new for example array
Not necessary in C++. This was getting flagged as a memory leak in the examples. Not a big deal, but can be done differently. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
a760f2952a
commit
2f051a202c
@ -44,7 +44,7 @@ main(int argc, char **argv)
|
|||||||
std::cout << "For the next " << NUMBER_OF_SECONDS << " seconds, "
|
std::cout << "For the next " << NUMBER_OF_SECONDS << " seconds, "
|
||||||
<< SAMPLES_PER_SECOND << " samples will be taken every second."
|
<< SAMPLES_PER_SECOND << " samples will be taken every second."
|
||||||
<< std::endl << std::endl;
|
<< std::endl << std::endl;
|
||||||
uint16_t* buffer = new uint16_t[NUMBER_OF_SECONDS * SAMPLES_PER_SECOND];
|
uint16_t buffer[NUMBER_OF_SECONDS * SAMPLES_PER_SECOND];
|
||||||
for (int i=0; i < NUMBER_OF_SECONDS * SAMPLES_PER_SECOND; i++) {
|
for (int i=0; i < NUMBER_OF_SECONDS * SAMPLES_PER_SECOND; i++) {
|
||||||
buffer[i] = (uint16_t) sensor->getSample();
|
buffer[i] = (uint16_t) sensor->getSample();
|
||||||
usleep(MICROSECONDS_PER_SECOND / SAMPLES_PER_SECOND);
|
usleep(MICROSECONDS_PER_SECOND / SAMPLES_PER_SECOND);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user