mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 05:42:20 +01:00
[quality] Use `uint8_t
instead of
unsigned char
`
This commit is contained in:
@@ -23,7 +23,7 @@ void DelonghiClimate::transmit_state() {
|
|||||||
|
|
||||||
data->mark(DELONGHI_HEADER_MARK);
|
data->mark(DELONGHI_HEADER_MARK);
|
||||||
data->space(DELONGHI_HEADER_SPACE);
|
data->space(DELONGHI_HEADER_SPACE);
|
||||||
for (unsigned char b : remote_state) {
|
for (uint8_t b : remote_state) {
|
||||||
for (uint8_t mask = 1; mask > 0; mask <<= 1) { // iterate through bit mask
|
for (uint8_t mask = 1; mask > 0; mask <<= 1) { // iterate through bit mask
|
||||||
data->mark(DELONGHI_BIT_MARK);
|
data->mark(DELONGHI_BIT_MARK);
|
||||||
bool bit = b & mask;
|
bool bit = b & mask;
|
||||||
|
@@ -110,10 +110,10 @@ static uint8_t find_nearest_index(float value, const float *arr, int size) {
|
|||||||
* @param value The float value to convert.
|
* @param value The float value to convert.
|
||||||
* @param bytes The byte array to store the converted value.
|
* @param bytes The byte array to store the converted value.
|
||||||
*/
|
*/
|
||||||
static void float_to_bytes(float value, unsigned char *bytes) {
|
static void float_to_bytes(float value, uint8_t *bytes) {
|
||||||
union {
|
union {
|
||||||
float float_value;
|
float float_value;
|
||||||
unsigned char byte_array[4];
|
uint8_t byte_array[4];
|
||||||
} u;
|
} u;
|
||||||
|
|
||||||
u.float_value = value;
|
u.float_value = value;
|
||||||
@@ -128,7 +128,7 @@ static void float_to_bytes(float value, unsigned char *bytes) {
|
|||||||
* @param value The 32-bit unsigned integer to convert.
|
* @param value The 32-bit unsigned integer to convert.
|
||||||
* @param bytes The byte array to store the converted value.
|
* @param bytes The byte array to store the converted value.
|
||||||
*/
|
*/
|
||||||
static void int_to_bytes(uint32_t value, unsigned char *bytes) {
|
static void int_to_bytes(uint32_t value, uint8_t *bytes) {
|
||||||
bytes[0] = value & 0xFF;
|
bytes[0] = value & 0xFF;
|
||||||
bytes[1] = (value >> 8) & 0xFF;
|
bytes[1] = (value >> 8) & 0xFF;
|
||||||
bytes[2] = (value >> 16) & 0xFF;
|
bytes[2] = (value >> 16) & 0xFF;
|
||||||
|
@@ -4,7 +4,7 @@ namespace esphome {
|
|||||||
namespace tm1638 {
|
namespace tm1638 {
|
||||||
namespace TM1638Translation {
|
namespace TM1638Translation {
|
||||||
|
|
||||||
const unsigned char SEVEN_SEG[] PROGMEM = {
|
const uint8_t SEVEN_SEG[] PROGMEM = {
|
||||||
0x00, /* (space) */
|
0x00, /* (space) */
|
||||||
0x86, /* ! */
|
0x86, /* ! */
|
||||||
0x22, /* " */
|
0x22, /* " */
|
||||||
|
Reference in New Issue
Block a user