Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include <furi.h>
|
||||
#include "../irda_i.h"
|
||||
|
||||
|
||||
IrdaMessage* irda_decoder_samsung32_check_ready(void* ctx) {
|
||||
return irda_common_decoder_check_ready(ctx);
|
||||
}
|
||||
@@ -19,7 +18,7 @@ bool irda_decoder_samsung32_interpret(IrdaCommonDecoder* decoder) {
|
||||
uint8_t command = decoder->data[2];
|
||||
uint8_t command_inverse = decoder->data[3];
|
||||
|
||||
if ((address1 == address2) && (command == (uint8_t) ~command_inverse)) {
|
||||
if((address1 == address2) && (command == (uint8_t)~command_inverse)) {
|
||||
decoder->message.command = command;
|
||||
decoder->message.address = address1;
|
||||
decoder->message.protocol = IrdaProtocolSamsung32;
|
||||
@@ -38,17 +37,15 @@ IrdaStatus irda_decoder_samsung32_decode_repeat(IrdaCommonDecoder* decoder) {
|
||||
uint32_t bit_tolerance = decoder->protocol->timings.bit_tolerance;
|
||||
IrdaStatus status = IrdaStatusError;
|
||||
|
||||
if (decoder->timings_cnt < 6)
|
||||
return IrdaStatusOk;
|
||||
if(decoder->timings_cnt < 6) return IrdaStatusOk;
|
||||
|
||||
if ((decoder->timings[0] > IRDA_SAMSUNG_REPEAT_PAUSE_MIN)
|
||||
&& (decoder->timings[0] < IRDA_SAMSUNG_REPEAT_PAUSE_MAX)
|
||||
&& MATCH_TIMING(decoder->timings[1], IRDA_SAMSUNG_REPEAT_MARK, preamble_tolerance)
|
||||
&& MATCH_TIMING(decoder->timings[2], IRDA_SAMSUNG_REPEAT_SPACE, preamble_tolerance)
|
||||
&& MATCH_TIMING(decoder->timings[3], decoder->protocol->timings.bit1_mark, bit_tolerance)
|
||||
&& MATCH_TIMING(decoder->timings[4], decoder->protocol->timings.bit1_space, bit_tolerance)
|
||||
&& MATCH_TIMING(decoder->timings[5], decoder->protocol->timings.bit1_mark, bit_tolerance)
|
||||
) {
|
||||
if((decoder->timings[0] > IRDA_SAMSUNG_REPEAT_PAUSE_MIN) &&
|
||||
(decoder->timings[0] < IRDA_SAMSUNG_REPEAT_PAUSE_MAX) &&
|
||||
MATCH_TIMING(decoder->timings[1], IRDA_SAMSUNG_REPEAT_MARK, preamble_tolerance) &&
|
||||
MATCH_TIMING(decoder->timings[2], IRDA_SAMSUNG_REPEAT_SPACE, preamble_tolerance) &&
|
||||
MATCH_TIMING(decoder->timings[3], decoder->protocol->timings.bit1_mark, bit_tolerance) &&
|
||||
MATCH_TIMING(decoder->timings[4], decoder->protocol->timings.bit1_space, bit_tolerance) &&
|
||||
MATCH_TIMING(decoder->timings[5], decoder->protocol->timings.bit1_mark, bit_tolerance)) {
|
||||
status = IrdaStatusReady;
|
||||
decoder->timings_cnt = 0;
|
||||
} else {
|
||||
@@ -73,4 +70,3 @@ void irda_decoder_samsung32_free(void* decoder) {
|
||||
void irda_decoder_samsung32_reset(void* decoder) {
|
||||
irda_common_decoder_reset(decoder);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user