mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add null GPIO pin (#6611)
This commit is contained in:
		| @@ -5,17 +5,13 @@ namespace cst226 { | ||||
|  | ||||
| void CST226Touchscreen::setup() { | ||||
|   esph_log_config(TAG, "Setting up CST226 Touchscreen..."); | ||||
|   if (this->reset_pin_ != nullptr) { | ||||
|     this->reset_pin_->setup(); | ||||
|     this->reset_pin_->digital_write(true); | ||||
|     delay(5); | ||||
|     this->reset_pin_->digital_write(false); | ||||
|     delay(5); | ||||
|     this->reset_pin_->digital_write(true); | ||||
|     this->set_timeout(30, [this] { this->continue_setup_(); }); | ||||
|   } else { | ||||
|     this->continue_setup_(); | ||||
|   } | ||||
|   this->reset_pin_->setup(); | ||||
|   this->reset_pin_->digital_write(true); | ||||
|   delay(5); | ||||
|   this->reset_pin_->digital_write(false); | ||||
|   delay(5); | ||||
|   this->reset_pin_->digital_write(true); | ||||
|   this->set_timeout(30, [this] { this->continue_setup_(); }); | ||||
| } | ||||
|  | ||||
| void CST226Touchscreen::update_touches() { | ||||
|   | ||||
| @@ -35,7 +35,7 @@ class CST226Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice | ||||
|   void continue_setup_(); | ||||
|  | ||||
|   InternalGPIOPin *interrupt_pin_{}; | ||||
|   GPIOPin *reset_pin_{}; | ||||
|   GPIOPin *reset_pin_{NULL_PIN}; | ||||
|   uint8_t chip_id_{}; | ||||
|   bool setup_complete_{}; | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user