unify lowercase x in hexadecimal values (#8686)

This commit is contained in:
Thomas Rupprecht 2025-05-04 22:47:57 +02:00 committed by GitHub
parent bc6ee20270
commit 670ad7192c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 42 additions and 42 deletions

View File

@ -7,7 +7,7 @@
namespace esphome { namespace esphome {
namespace as7341 { namespace as7341 {
static const uint8_t AS7341_CHIP_ID = 0X09; static const uint8_t AS7341_CHIP_ID = 0x09;
static const uint8_t AS7341_CONFIG = 0x70; static const uint8_t AS7341_CONFIG = 0x70;
static const uint8_t AS7341_LED = 0x74; static const uint8_t AS7341_LED = 0x74;

View File

@ -45,7 +45,7 @@ static const uint8_t BL0906_WRITE_COMMAND = 0xCA;
static const uint8_t BL0906_V_RMS = 0x16; static const uint8_t BL0906_V_RMS = 0x16;
// Total power // Total power
static const uint8_t BL0906_WATT_SUM = 0X2C; static const uint8_t BL0906_WATT_SUM = 0x2C;
// Current1~6 // Current1~6
static const uint8_t BL0906_I_1_RMS = 0x0D; // current_1 static const uint8_t BL0906_I_1_RMS = 0x0D; // current_1
@ -56,29 +56,29 @@ static const uint8_t BL0906_I_5_RMS = 0x13;
static const uint8_t BL0906_I_6_RMS = 0x14; // current_6 static const uint8_t BL0906_I_6_RMS = 0x14; // current_6
// Power1~6 // Power1~6
static const uint8_t BL0906_WATT_1 = 0X23; // power_1 static const uint8_t BL0906_WATT_1 = 0x23; // power_1
static const uint8_t BL0906_WATT_2 = 0X24; static const uint8_t BL0906_WATT_2 = 0x24;
static const uint8_t BL0906_WATT_3 = 0X25; static const uint8_t BL0906_WATT_3 = 0x25;
static const uint8_t BL0906_WATT_4 = 0X26; static const uint8_t BL0906_WATT_4 = 0x26;
static const uint8_t BL0906_WATT_5 = 0X29; static const uint8_t BL0906_WATT_5 = 0x29;
static const uint8_t BL0906_WATT_6 = 0X2A; // power_6 static const uint8_t BL0906_WATT_6 = 0x2A; // power_6
// Active pulse count, unsigned // Active pulse count, unsigned
static const uint8_t BL0906_CF_1_CNT = 0X30; // Channel_1 static const uint8_t BL0906_CF_1_CNT = 0x30; // Channel_1
static const uint8_t BL0906_CF_2_CNT = 0X31; static const uint8_t BL0906_CF_2_CNT = 0x31;
static const uint8_t BL0906_CF_3_CNT = 0X32; static const uint8_t BL0906_CF_3_CNT = 0x32;
static const uint8_t BL0906_CF_4_CNT = 0X33; static const uint8_t BL0906_CF_4_CNT = 0x33;
static const uint8_t BL0906_CF_5_CNT = 0X36; static const uint8_t BL0906_CF_5_CNT = 0x36;
static const uint8_t BL0906_CF_6_CNT = 0X37; // Channel_6 static const uint8_t BL0906_CF_6_CNT = 0x37; // Channel_6
// Total active pulse count, unsigned // Total active pulse count, unsigned
static const uint8_t BL0906_CF_SUM_CNT = 0X39; static const uint8_t BL0906_CF_SUM_CNT = 0x39;
// Voltage frequency cycle // Voltage frequency cycle
static const uint8_t BL0906_FREQUENCY = 0X4E; static const uint8_t BL0906_FREQUENCY = 0x4E;
// Internal temperature // Internal temperature
static const uint8_t BL0906_TEMPERATURE = 0X5E; static const uint8_t BL0906_TEMPERATURE = 0x5E;
// Calibration register // Calibration register
// RMS gain adjustment register // RMS gain adjustment register

View File

@ -32,7 +32,7 @@ const uint32_t FAN_MAX = 0x40;
// Temperature // Temperature
const uint8_t TEMP_RANGE = TEMP_MAX - TEMP_MIN + 1; const uint8_t TEMP_RANGE = TEMP_MAX - TEMP_MIN + 1;
const uint32_t TEMP_MASK = 0XF00; const uint32_t TEMP_MASK = 0xF00;
const uint32_t TEMP_SHIFT = 8; const uint32_t TEMP_SHIFT = 8;
const uint16_t BITS = 28; const uint16_t BITS = 28;

View File

@ -8,7 +8,7 @@
namespace esphome { namespace esphome {
namespace hm3301 { namespace hm3301 {
static const uint8_t SELECT_COMM_CMD = 0X88; static const uint8_t SELECT_COMM_CMD = 0x88;
class HM3301Component : public PollingComponent, public i2c::I2CDevice { class HM3301Component : public PollingComponent, public i2c::I2CDevice {
public: public:

View File

@ -388,7 +388,7 @@ static const uint8_t PROGMEM INITCMD_GC9D01N[] = {
0x8D, 1, 0xFF, 0x8D, 1, 0xFF,
0x8E, 1, 0xFF, 0x8E, 1, 0xFF,
0x8F, 1, 0xFF, 0x8F, 1, 0xFF,
0X3A, 1, 0x05, // COLMOD: Pixel Format Set (3Ah) MCU interface, 16 bits / pixel 0x3A, 1, 0x05, // COLMOD: Pixel Format Set (3Ah) MCU interface, 16 bits / pixel
0xEC, 1, 0x01, // Inversion (ECh) DINV=1+2H1V column for Dual Gate (BFh=0) 0xEC, 1, 0x01, // Inversion (ECh) DINV=1+2H1V column for Dual Gate (BFh=0)
// According to datasheet Inversion (ECh) value 0x01 isn't valid, but Lilygo uses it everywhere // According to datasheet Inversion (ECh) value 0x01 isn't valid, but Lilygo uses it everywhere
0x74, 7, 0x02, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 7, 0x02, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,

View File

@ -129,7 +129,7 @@ enum PeriodicDataStructure : uint8_t {
LIGHT_SENSOR = 37, LIGHT_SENSOR = 37,
OUT_PIN_SENSOR = 38, OUT_PIN_SENSOR = 38,
}; };
enum PeriodicDataValue : uint8_t { HEAD = 0XAA, END = 0x55, CHECK = 0x00 }; enum PeriodicDataValue : uint8_t { HEAD = 0xAA, END = 0x55, CHECK = 0x00 };
enum AckDataStructure : uint8_t { COMMAND = 6, COMMAND_STATUS = 7 }; enum AckDataStructure : uint8_t { COMMAND = 6, COMMAND_STATUS = 7 };

View File

@ -105,7 +105,7 @@ enum PeriodicDataStructure : uint8_t {
TARGET_RESOLUTION = 10, TARGET_RESOLUTION = 10,
}; };
enum PeriodicDataValue : uint8_t { HEAD = 0XAA, END = 0x55, CHECK = 0x00 }; enum PeriodicDataValue : uint8_t { HEAD = 0xAA, END = 0x55, CHECK = 0x00 };
enum AckDataStructure : uint8_t { COMMAND = 6, COMMAND_STATUS = 7 }; enum AckDataStructure : uint8_t { COMMAND = 6, COMMAND_STATUS = 7 };

View File

@ -25,8 +25,8 @@ const uint8_t MITSUBISHI_FAN_AUTO = 0x00;
const uint8_t MITSUBISHI_VERTICAL_VANE_SWING = 0x38; const uint8_t MITSUBISHI_VERTICAL_VANE_SWING = 0x38;
// const uint8_t MITSUBISHI_AUTO = 0X80; // const uint8_t MITSUBISHI_AUTO = 0x80;
const uint8_t MITSUBISHI_OTHERWISE = 0X40; const uint8_t MITSUBISHI_OTHERWISE = 0x40;
const uint8_t MITSUBISHI_POWERFUL = 0x08; const uint8_t MITSUBISHI_POWERFUL = 0x08;
// Optional presets used to enable some model features // Optional presets used to enable some model features
@ -42,13 +42,13 @@ const uint16_t MITSUBISHI_HEADER_SPACE = 1700;
const uint16_t MITSUBISHI_MIN_GAP = 17500; const uint16_t MITSUBISHI_MIN_GAP = 17500;
// Marker bytes // Marker bytes
const uint8_t MITSUBISHI_BYTE00 = 0X23; const uint8_t MITSUBISHI_BYTE00 = 0x23;
const uint8_t MITSUBISHI_BYTE01 = 0XCB; const uint8_t MITSUBISHI_BYTE01 = 0xCB;
const uint8_t MITSUBISHI_BYTE02 = 0X26; const uint8_t MITSUBISHI_BYTE02 = 0x26;
const uint8_t MITSUBISHI_BYTE03 = 0X01; const uint8_t MITSUBISHI_BYTE03 = 0x01;
const uint8_t MITSUBISHI_BYTE04 = 0X00; const uint8_t MITSUBISHI_BYTE04 = 0x00;
const uint8_t MITSUBISHI_BYTE13 = 0X00; const uint8_t MITSUBISHI_BYTE13 = 0x00;
const uint8_t MITSUBISHI_BYTE16 = 0X00; const uint8_t MITSUBISHI_BYTE16 = 0x00;
climate::ClimateTraits MitsubishiClimate::traits() { climate::ClimateTraits MitsubishiClimate::traits() {
auto traits = climate::ClimateTraits(); auto traits = climate::ClimateTraits();

View File

@ -123,8 +123,8 @@ enum class NCIState : uint8_t {
RFST_POLL_ACTIVE, RFST_POLL_ACTIVE,
EP_DEACTIVATING, EP_DEACTIVATING,
EP_SELECTING, EP_SELECTING,
TEST = 0XFE, TEST = 0xFE,
FAILED = 0XFF, FAILED = 0xFF,
}; };
enum class TestMode : uint8_t { enum class TestMode : uint8_t {

View File

@ -138,8 +138,8 @@ enum class NCIState : uint8_t {
RFST_POLL_ACTIVE, RFST_POLL_ACTIVE,
EP_DEACTIVATING, EP_DEACTIVATING,
EP_SELECTING, EP_SELECTING,
TEST = 0XFE, TEST = 0xFE,
FAILED = 0XFF, FAILED = 0xFF,
}; };
enum class TestMode : uint8_t { enum class TestMode : uint8_t {

View File

@ -1004,7 +1004,7 @@ void WaveshareEPaper1P54InBV2::initialize() {
this->command(0x4E); // set RAM x address count to 0; this->command(0x4E); // set RAM x address count to 0;
this->data(0x00); this->data(0x00);
this->command(0x4F); // set RAM y address count to 0X199; this->command(0x4F); // set RAM y address count to 0x199;
this->data(0xC7); this->data(0xC7);
this->data(0x00); this->data(0x00);
@ -1878,7 +1878,7 @@ void GDEY029T94::initialize() {
this->command(0x4E); // set RAM x address count to 0; this->command(0x4E); // set RAM x address count to 0;
this->data(0x00); this->data(0x00);
this->command(0x4F); // set RAM y address count to 0X199; this->command(0x4F); // set RAM y address count to 0x199;
this->command(0x00); this->command(0x00);
this->command(0x00); this->command(0x00);
this->wait_until_idle_(); this->wait_until_idle_();
@ -2070,7 +2070,7 @@ void GDEW029T5::init_full_() {
this->init_display_(); this->init_display_();
this->command(0x82); // vcom_DC setting this->command(0x82); // vcom_DC setting
this->data(0x08); this->data(0x08);
this->command(0X50); // VCOM AND DATA INTERVAL SETTING this->command(0x50); // VCOM AND DATA INTERVAL SETTING
this->data(0x97); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 this->data(0x97); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7
this->command(0x20); this->command(0x20);
this->write_lut_(LUT_20_VCOMDC_29_5, sizeof(LUT_20_VCOMDC_29_5)); this->write_lut_(LUT_20_VCOMDC_29_5, sizeof(LUT_20_VCOMDC_29_5));
@ -2090,7 +2090,7 @@ void GDEW029T5::init_partial_() {
this->init_display_(); this->init_display_();
this->command(0x82); // vcom_DC setting this->command(0x82); // vcom_DC setting
this->data(0x08); this->data(0x08);
this->command(0X50); // VCOM AND DATA INTERVAL SETTING this->command(0x50); // VCOM AND DATA INTERVAL SETTING
this->data(0x17); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 this->data(0x17); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7
this->command(0x20); this->command(0x20);
this->write_lut_(LUT_20_VCOMDC_PARTIAL_29_5, sizeof(LUT_20_VCOMDC_PARTIAL_29_5)); this->write_lut_(LUT_20_VCOMDC_PARTIAL_29_5, sizeof(LUT_20_VCOMDC_PARTIAL_29_5));
@ -4481,10 +4481,10 @@ void WaveshareEPaper7P5InHDB::initialize() {
this->data(0x01); // LUT1, for white this->data(0x01); // LUT1, for white
this->command(0x18); this->command(0x18);
this->data(0X80); this->data(0x80);
this->command(0x22); this->command(0x22);
this->data(0XB1); // Load Temperature and waveform setting. this->data(0xB1); // Load Temperature and waveform setting.
this->command(0x20); this->command(0x20);

View File

@ -32,7 +32,7 @@ void XPT2046Component::update_touches() {
int16_t touch_pressure_1 = this->read_adc_(0xB1 /* touch_pressure_1 */); int16_t touch_pressure_1 = this->read_adc_(0xB1 /* touch_pressure_1 */);
int16_t touch_pressure_2 = this->read_adc_(0xC1 /* touch_pressure_2 */); int16_t touch_pressure_2 = this->read_adc_(0xC1 /* touch_pressure_2 */);
z_raw = touch_pressure_1 + 0Xfff - touch_pressure_2; z_raw = touch_pressure_1 + 0xfff - touch_pressure_2;
ESP_LOGVV(TAG, "Touchscreen Update z = %d", z_raw); ESP_LOGVV(TAG, "Touchscreen Update z = %d", z_raw);
touch = (z_raw >= this->threshold_); touch = (z_raw >= this->threshold_);
if (touch) { if (touch) {