From c7c1127105fe178ba92b447d78a5dab49181f3f8 Mon Sep 17 00:00:00 2001 From: AmirReza-Bahrami <155799896+AmirReza-Bahrami@users.noreply.github.com> Date: Mon, 18 Aug 2025 18:11:48 +0330 Subject: [PATCH 1/2] Update ask.h The function ask_getDECval(ask_t *ask) was declared on line 73. --- ask.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ask.h b/ask.h index 39bea5d..e6af077 100644 --- a/ask.h +++ b/ask.h @@ -70,6 +70,7 @@ uint16_t ask_read_time_of_bit(ask_t *ask); // return readed data bit t void ask_send_bytes(ask_t *ask, uint8_t *data, uint8_t len, uint32_t bit_time_micros, uint8_t try_to_send); // send data int16_t ask_checkChannelLast4Bit(uint8_t *newCode, uint8_t *refrence, uint8_t len); // compare and return channel, return -1 if failed int16_t ask_checkChannelLast8Bit(uint8_t *newCode, uint8_t *refrence, uint8_t len); // compare and return channel, return -1 if failed +uint32_t ask_get_DECval(ask_t *ask); // Return received 24-bit value #ifdef __cplusplus } From 84b09f1a3a05257ea10dc9f84295ea87133b78ce Mon Sep 17 00:00:00 2001 From: AmirReza-Bahrami <155799896+AmirReza-Bahrami@users.noreply.github.com> Date: Mon, 18 Aug 2025 18:14:54 +0330 Subject: [PATCH 2/2] Update ask.c The function ask_getDECval(ask_t *ask) was Implemented on line 245. --- ask.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ask.c b/ask.c index a4cb40a..6074dc7 100644 --- a/ask.c +++ b/ask.c @@ -242,3 +242,14 @@ int16_t ask_checkChannelLast8Bit(uint8_t *newCode, uint8_t *refrence, uint8_t le return newCode[len - 1]; } //################################################################################################################ +uint32_t ask_get_DECval(ask_t *ask) { + uint32_t Data[3] = { 0 }; + uint8_t data[3] = { 0 }; + ask_read_bytes(ask, data); + + Data[0] = data[0]; + Data[1] = data[1]; + Data[2] = data[2]; + return ((Data[0] << 16) | (Data[1] << 8) | Data[2]); +} +//################################################################################################################