[sgp30] Fix serial number truncation from 48-bit to 24-bit (#14478)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
55103c0652
commit
b6d7e8e14d
1 file changed
+3
-1
@@ -41,7 +41,9 @@ void SGP30Component::setup() {
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
this->serial_number_ = encode_uint24(raw_serial_number[0], raw_serial_number[1], raw_serial_number[2]);
|
||||
this->serial_number_ = (static_cast<uint64_t>(raw_serial_number[0]) << 32) |
|
||||
(static_cast<uint64_t>(raw_serial_number[1]) << 16) |
|
||||
static_cast<uint64_t>(raw_serial_number[2]);
|
||||
ESP_LOGD(TAG, "Serial number: %" PRIu64, this->serial_number_);
|
||||
|
||||
// Featureset identification for future use
|
||||
|
||||
Reference in new issue
Block a user