mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	[online_image] Use RAMAllocator (#8114)
This commit is contained in:
		| @@ -100,7 +100,7 @@ class DownloadBuffer { | ||||
|   void reset() { this->unread_ = 0; } | ||||
|  | ||||
|  protected: | ||||
|   ExternalRAMAllocator<uint8_t> allocator_; | ||||
|   RAMAllocator<uint8_t> allocator_{}; | ||||
|   uint8_t *buffer_; | ||||
|   size_t size_; | ||||
|   /** Total number of downloaded bytes not yet read. */ | ||||
|   | ||||
| @@ -83,8 +83,7 @@ class OnlineImage : public PollingComponent, | ||||
|  protected: | ||||
|   bool validate_url_(const std::string &url); | ||||
|  | ||||
|   using Allocator = ExternalRAMAllocator<uint8_t>; | ||||
|   Allocator allocator_{Allocator::Flags::ALLOW_FAILURE}; | ||||
|   RAMAllocator<uint8_t> allocator_{}; | ||||
|  | ||||
|   uint32_t get_buffer_size_() const { return get_buffer_size_(this->buffer_width_, this->buffer_height_); } | ||||
|   int get_buffer_size_(int width, int height) const { return (this->get_bpp() * width + 7u) / 8u * height; } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user