mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 12:30:59 +02:00
Allows user to bypass PSRAM test and boot faster with WROVER (#6135)
Fixes #5737
This commit is contained in:
@ -166,6 +166,7 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
|
|||||||
#include "Udp.h"
|
#include "Udp.h"
|
||||||
#include "HardwareSerial.h"
|
#include "HardwareSerial.h"
|
||||||
#include "Esp.h"
|
#include "Esp.h"
|
||||||
|
#include "esp32/spiram.h"
|
||||||
|
|
||||||
using std::abs;
|
using std::abs;
|
||||||
using std::isinf;
|
using std::isinf;
|
||||||
@ -181,7 +182,10 @@ uint16_t makeWord(uint8_t h, uint8_t l);
|
|||||||
|
|
||||||
size_t getArduinoLoopTaskStackSize(void);
|
size_t getArduinoLoopTaskStackSize(void);
|
||||||
#define SET_LOOP_TASK_STACK_SIZE(sz) size_t getArduinoLoopTaskStackSize() { return sz;}
|
#define SET_LOOP_TASK_STACK_SIZE(sz) size_t getArduinoLoopTaskStackSize() { return sz;}
|
||||||
|
|
||||||
|
// allows user to bypass esp_spiram_test()
|
||||||
|
#define BYPASS_SPIRAM_TEST(bypass) bool testSPIRAM(void) { if (bypass) return true; else return esp_spiram_test(); }
|
||||||
|
|
||||||
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
||||||
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
||||||
|
|
||||||
|
@ -35,6 +35,13 @@
|
|||||||
static volatile bool spiramDetected = false;
|
static volatile bool spiramDetected = false;
|
||||||
static volatile bool spiramFailed = false;
|
static volatile bool spiramFailed = false;
|
||||||
|
|
||||||
|
//allows user to bypass SPI RAM test routine
|
||||||
|
__attribute__((weak)) bool testSPIRAM(void)
|
||||||
|
{
|
||||||
|
return esp_spiram_test();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool psramInit(){
|
bool psramInit(){
|
||||||
if (spiramDetected) {
|
if (spiramDetected) {
|
||||||
return true;
|
return true;
|
||||||
@ -66,7 +73,8 @@ bool psramInit(){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
esp_spiram_init_cache();
|
esp_spiram_init_cache();
|
||||||
if (!esp_spiram_test()) {
|
//testSPIRAM() allows user to bypass SPI RAM test routine
|
||||||
|
if (!testSPIRAM()) {
|
||||||
spiramFailed = true;
|
spiramFailed = true;
|
||||||
log_e("PSRAM test failed!");
|
log_e("PSRAM test failed!");
|
||||||
return false;
|
return false;
|
||||||
|
@ -95,6 +95,9 @@ void analogWrite(uint8_t pin, int value);
|
|||||||
//returns chip temperature in Celsius
|
//returns chip temperature in Celsius
|
||||||
float temperatureRead();
|
float temperatureRead();
|
||||||
|
|
||||||
|
//allows user to bypass SPI RAM test routine
|
||||||
|
bool testSPIRAM(void);
|
||||||
|
|
||||||
#if CONFIG_AUTOSTART_ARDUINO
|
#if CONFIG_AUTOSTART_ARDUINO
|
||||||
//enable/disable WDT for Arduino's setup and loop functions
|
//enable/disable WDT for Arduino's setup and loop functions
|
||||||
void enableLoopWDT();
|
void enableLoopWDT();
|
||||||
|
Reference in New Issue
Block a user