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