Figured out how to turn on PSRAM
Now it looks like you can just allocate from a regular "malloc" Code ran successfully (afaict) when writing to 7MB - didn't seem to when doing 8MB. Not 100% sure why, but I don't think it'll matter tbh
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "dht22.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#define DATA_GPIO CONFIG_DHT22_DATA_GPIO
|
||||
|
||||
@@ -15,7 +16,6 @@ deci_degrees_c _dht22_temperature = INT16_MIN;
|
||||
dht22_error dht22_read() {
|
||||
uint8_t data[5] = {0};
|
||||
|
||||
|
||||
// TODO: Actually figure out how to read the data from the chip.
|
||||
|
||||
// TODO test that data[x] << 8 will be promoted to 16bits otherwise I'm shifting them to just zeros
|
||||
@@ -28,6 +28,7 @@ dht22_error dht22_read() {
|
||||
if (checksum_val != data[4]) {
|
||||
_dht22_relative_humidity = UINT16_MAX;
|
||||
_dht22_temperature = INT16_MIN;
|
||||
ESP_LOGE(TAG, "Error in final checksum check");
|
||||
return DHT22_CHECKSUM_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user