-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#14 Initial and failed test to use Vector (error in wakeup)
- Loading branch information
1 parent
c66d355
commit 9de124a
Showing
7 changed files
with
130 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <stdio.h> | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/task.h" | ||
#include <string.h> | ||
#include <vector> | ||
using namespace std; | ||
|
||
vector<int> vic(100); | ||
|
||
|
||
extern "C" | ||
{ | ||
void app_main(); | ||
} | ||
|
||
|
||
void app_main() { | ||
|
||
uint16_t custom_size = 10000; | ||
// 1068 bytes | ||
/* | ||
uint8_t static_buffer[custom_size]; | ||
for (uint16_t i = 0; i<sizeof(static_buffer); ++i) { | ||
static_buffer[i] = 0xff; | ||
} */ | ||
|
||
|
||
|
||
// Takes 1004 2072 of heap | ||
/* uint8_t* p = (uint8_t*) malloc(custom_size); | ||
memset(p, 1, custom_size); */ | ||
|
||
// int : 5072 of heap | ||
// uint8_t : 2164 of heap | ||
// Dynamic size vector | ||
vector<uint8_t> vic; | ||
vector<uint8_t>::iterator buffer_pos; | ||
buffer_pos = vic.begin(); | ||
|
||
for (uint16_t i = 0; i<10; ++i) { | ||
// Hangs everything | ||
//vic.insert(buffer_pos+i, 0xff); | ||
vic.push_back(0xff); | ||
} | ||
|
||
//printf("Hello this is a Vector test\n"); | ||
|
||
printf("Free heap: %d vector size: %d\n", xPortGetFreeHeapSize(), vic.size()); | ||
} |