mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-10-30 04:26:50 +03:00 
			
		
		
		
	* help in makefile * fix some device tests, http_server is pending * fix webserver test, one test is disabled due to general python2->3 failure * remove debug strings * minimize diff * set reset method back to the default one on generic board * fix vcc range check from datasheet vcc is read as 2.9V here, datasheet says 2.5-3.6, old low limit was 3v * tell python to decode string
		
			
				
	
	
		
			44 lines
		
	
	
		
			629 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			629 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include <BSTest.h>
 | |
| BS_ENV_DECLARE();
 | |
| 
 | |
| ADC_MODE(ADC_VCC);
 | |
| RF_MODE(RF_CAL);
 | |
| 
 | |
| static int rf_pre_init_flag = 0;
 | |
| 
 | |
| RF_PRE_INIT()
 | |
| {
 | |
|     rf_pre_init_flag = 42;
 | |
| }
 | |
| 
 | |
| static unsigned setup_micros;
 | |
| 
 | |
| void setup()
 | |
| {
 | |
|     setup_micros = micros();
 | |
|     Serial.begin(115200);
 | |
|     BS_RUN(Serial);
 | |
| }
 | |
| 
 | |
| bool pretest()
 | |
| {
 | |
|     return true;
 | |
| }
 | |
| 
 | |
| TEST_CASE("ADC_MODE override works", "[core]")
 | |
| {
 | |
|     auto vcc = ESP.getVcc();
 | |
|     Serial.printf("VCC: %d\r\n", vcc);
 | |
|     Serial.printf("A0: %d\r\n", analogRead(A0));
 | |
|     CHECK(vcc > 2500 && vcc < 3600);
 | |
| }
 | |
| 
 | |
| TEST_CASE("RF_PRE_INIT override works", "[core]")
 | |
| {
 | |
|     CHECK(rf_pre_init_flag == 42);
 | |
| }
 | |
| 
 | |
| void loop()
 | |
| {
 | |
| }
 |