Skip to content

Commit 2da961f

Browse files
Add PSRAM test example
1 parent a433e99 commit 2da961f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* Heltec Automation ESP32 external PSRAM read/write example
2+
*
3+
* Must have external PSRAM connected.
4+
*
5+
* HelTec AutoMation, Chengdu, China
6+
* 成都惠利特自动化科技有限公司
7+
* https://heltec.org
8+
*
9+
* this project also realess in GitHub:
10+
* https://github.com/HelTecAutomation/Heltec_ESP32
11+
*/
12+
13+
14+
#include <Arduino.h>
15+
16+
void setup() {
17+
Serial.begin(115200);
18+
19+
Serial.printf("Total heap: %d\r\n", ESP.getHeapSize());
20+
Serial.printf("Free heap: %d\r\n", ESP.getFreeHeap());
21+
Serial.printf("Total PSRAM: %d\r\n", ESP.getPsramSize());
22+
byte* psdRamBuffer = (byte*)ps_malloc(4000000);
23+
Serial.printf("Free PSRAM: %d\r\n", ESP.getFreePsram());
24+
}
25+
26+
void loop() {}

0 commit comments

Comments
 (0)