mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 13:46:37 +00:00
Fix possible compile error
Fix possible compile error
This commit is contained in:
parent
127892e0c1
commit
a380eb9566
@ -81,6 +81,27 @@ void IrSendInit(void)
|
|||||||
#endif //USE_IR_HVAC
|
#endif //USE_IR_HVAC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* IrUint64toHex(uint64_t value, char *str, uint16_t bits)
|
||||||
|
{
|
||||||
|
ulltoa(value, str, 16); // Get 64bit value
|
||||||
|
|
||||||
|
int fill = 8;
|
||||||
|
if ((bits > 3) && (bits < 65)) {
|
||||||
|
fill = bits / 4; // Max 16
|
||||||
|
if (bits % 4) { fill++; }
|
||||||
|
}
|
||||||
|
int len = strlen(str);
|
||||||
|
fill -= len;
|
||||||
|
if (fill > 0) {
|
||||||
|
memmove(str + fill, str, len +1);
|
||||||
|
memset(str, '0', fill);
|
||||||
|
}
|
||||||
|
memmove(str + 2, str, strlen(str) +1);
|
||||||
|
str[0] = '0';
|
||||||
|
str[1] = 'x';
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_IR_RECEIVE
|
#ifdef USE_IR_RECEIVE
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* IR Receive
|
* IR Receive
|
||||||
@ -105,24 +126,6 @@ void IrReceiveInit(void)
|
|||||||
// AddLog_P(LOG_LEVEL_DEBUG, PSTR("IrReceive initialized"));
|
// AddLog_P(LOG_LEVEL_DEBUG, PSTR("IrReceive initialized"));
|
||||||
}
|
}
|
||||||
|
|
||||||
char* IrUint64toHex(uint64_t value, char *str, uint16_t bits)
|
|
||||||
{
|
|
||||||
ulltoa(value, str, 16); // Get 64bit value
|
|
||||||
|
|
||||||
int fill = 8;
|
|
||||||
if ((bits > 3) && (bits < 65)) { fill = bits / 4 ; } // Max 16
|
|
||||||
int len = strlen(str);
|
|
||||||
fill -= len;
|
|
||||||
if (fill > 0) {
|
|
||||||
memmove(str + fill, str, len +1);
|
|
||||||
memset(str, '0', fill);
|
|
||||||
}
|
|
||||||
memmove(str + 2, str, strlen(str) +1);
|
|
||||||
str[0] = '0';
|
|
||||||
str[1] = 'x';
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IrReceiveCheck(void)
|
void IrReceiveCheck(void)
|
||||||
{
|
{
|
||||||
char sirtype[14]; // Max is AIWA_RC_T501
|
char sirtype[14]; // Max is AIWA_RC_T501
|
||||||
|
Loading…
x
Reference in New Issue
Block a user