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:
あく
2022-01-05 19:10:18 +03:00
committed by GitHub
parent c98e54da10
commit 389ff92cc1
899 changed files with 379245 additions and 373421 deletions

View File

@@ -2,18 +2,19 @@
#include "irda_protocol_defs_i.h"
const IrdaCommonProtocolSpec protocol_nec = {
.timings = {
.preamble_mark = IRDA_NEC_PREAMBLE_MARK,
.preamble_space = IRDA_NEC_PREAMBLE_SPACE,
.bit1_mark = IRDA_NEC_BIT1_MARK,
.bit1_space = IRDA_NEC_BIT1_SPACE,
.bit0_mark = IRDA_NEC_BIT0_MARK,
.bit0_space = IRDA_NEC_BIT0_SPACE,
.preamble_tolerance = IRDA_NEC_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_NEC_BIT_TOLERANCE,
.silence_time = IRDA_NEC_SILENCE,
.min_split_time = IRDA_NEC_MIN_SPLIT_TIME,
},
.timings =
{
.preamble_mark = IRDA_NEC_PREAMBLE_MARK,
.preamble_space = IRDA_NEC_PREAMBLE_SPACE,
.bit1_mark = IRDA_NEC_BIT1_MARK,
.bit1_space = IRDA_NEC_BIT1_SPACE,
.bit0_mark = IRDA_NEC_BIT0_MARK,
.bit0_space = IRDA_NEC_BIT0_SPACE,
.preamble_tolerance = IRDA_NEC_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_NEC_BIT_TOLERANCE,
.silence_time = IRDA_NEC_SILENCE,
.min_split_time = IRDA_NEC_MIN_SPLIT_TIME,
},
.databit_len[0] = 42,
.databit_len[1] = 32,
.no_stop_bit = false,
@@ -25,18 +26,19 @@ const IrdaCommonProtocolSpec protocol_nec = {
};
const IrdaCommonProtocolSpec protocol_samsung32 = {
.timings = {
.preamble_mark = IRDA_SAMSUNG_PREAMBLE_MARK,
.preamble_space = IRDA_SAMSUNG_PREAMBLE_SPACE,
.bit1_mark = IRDA_SAMSUNG_BIT1_MARK,
.bit1_space = IRDA_SAMSUNG_BIT1_SPACE,
.bit0_mark = IRDA_SAMSUNG_BIT0_MARK,
.bit0_space = IRDA_SAMSUNG_BIT0_SPACE,
.preamble_tolerance = IRDA_SAMSUNG_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_SAMSUNG_BIT_TOLERANCE,
.silence_time = IRDA_SAMSUNG_SILENCE,
.min_split_time = IRDA_SAMSUNG_MIN_SPLIT_TIME,
},
.timings =
{
.preamble_mark = IRDA_SAMSUNG_PREAMBLE_MARK,
.preamble_space = IRDA_SAMSUNG_PREAMBLE_SPACE,
.bit1_mark = IRDA_SAMSUNG_BIT1_MARK,
.bit1_space = IRDA_SAMSUNG_BIT1_SPACE,
.bit0_mark = IRDA_SAMSUNG_BIT0_MARK,
.bit0_space = IRDA_SAMSUNG_BIT0_SPACE,
.preamble_tolerance = IRDA_SAMSUNG_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_SAMSUNG_BIT_TOLERANCE,
.silence_time = IRDA_SAMSUNG_SILENCE,
.min_split_time = IRDA_SAMSUNG_MIN_SPLIT_TIME,
},
.databit_len[0] = 32,
.no_stop_bit = false,
.decode = irda_common_decode_pdwm,
@@ -47,16 +49,19 @@ const IrdaCommonProtocolSpec protocol_samsung32 = {
};
const IrdaCommonProtocolSpec protocol_rc6 = {
.timings = {
.preamble_mark = IRDA_RC6_PREAMBLE_MARK,
.preamble_space = IRDA_RC6_PREAMBLE_SPACE,
.bit1_mark = IRDA_RC6_BIT,
.preamble_tolerance = IRDA_RC6_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_RC6_BIT_TOLERANCE,
.silence_time = IRDA_RC6_SILENCE,
.min_split_time = IRDA_RC6_MIN_SPLIT_TIME,
},
.databit_len[0] = 1 + 3 + 1 + 8 + 8, // start_bit + 3 mode bits, + 1 toggle bit (x2 timing) + 8 address + 8 command
.timings =
{
.preamble_mark = IRDA_RC6_PREAMBLE_MARK,
.preamble_space = IRDA_RC6_PREAMBLE_SPACE,
.bit1_mark = IRDA_RC6_BIT,
.preamble_tolerance = IRDA_RC6_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_RC6_BIT_TOLERANCE,
.silence_time = IRDA_RC6_SILENCE,
.min_split_time = IRDA_RC6_MIN_SPLIT_TIME,
},
.databit_len[0] =
1 + 3 + 1 + 8 +
8, // start_bit + 3 mode bits, + 1 toggle bit (x2 timing) + 8 address + 8 command
.manchester_start_from_space = false,
.decode = irda_decoder_rc6_decode_manchester,
.encode = irda_encoder_rc6_encode_manchester,
@@ -66,16 +71,18 @@ const IrdaCommonProtocolSpec protocol_rc6 = {
};
const IrdaCommonProtocolSpec protocol_rc5 = {
.timings = {
.preamble_mark = 0,
.preamble_space = 0,
.bit1_mark = IRDA_RC5_BIT,
.preamble_tolerance = 0,
.bit_tolerance = IRDA_RC5_BIT_TOLERANCE,
.silence_time = IRDA_RC5_SILENCE,
.min_split_time = IRDA_RC5_MIN_SPLIT_TIME,
},
.databit_len[0] = 1 + 1 + 1 + 5 + 6, // start_bit + start_bit/command_bit + toggle_bit + 5 address + 6 command
.timings =
{
.preamble_mark = 0,
.preamble_space = 0,
.bit1_mark = IRDA_RC5_BIT,
.preamble_tolerance = 0,
.bit_tolerance = IRDA_RC5_BIT_TOLERANCE,
.silence_time = IRDA_RC5_SILENCE,
.min_split_time = IRDA_RC5_MIN_SPLIT_TIME,
},
.databit_len[0] = 1 + 1 + 1 + 5 +
6, // start_bit + start_bit/command_bit + toggle_bit + 5 address + 6 command
.manchester_start_from_space = true,
.decode = irda_common_decode_manchester,
.encode = irda_common_encode_manchester,
@@ -85,18 +92,19 @@ const IrdaCommonProtocolSpec protocol_rc5 = {
};
const IrdaCommonProtocolSpec protocol_sirc = {
.timings = {
.preamble_mark = IRDA_SIRC_PREAMBLE_MARK,
.preamble_space = IRDA_SIRC_PREAMBLE_SPACE,
.bit1_mark = IRDA_SIRC_BIT1_MARK,
.bit1_space = IRDA_SIRC_BIT1_SPACE,
.bit0_mark = IRDA_SIRC_BIT0_MARK,
.bit0_space = IRDA_SIRC_BIT0_SPACE,
.preamble_tolerance = IRDA_SIRC_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_SIRC_BIT_TOLERANCE,
.silence_time = IRDA_SIRC_SILENCE,
.min_split_time = IRDA_SIRC_MIN_SPLIT_TIME,
},
.timings =
{
.preamble_mark = IRDA_SIRC_PREAMBLE_MARK,
.preamble_space = IRDA_SIRC_PREAMBLE_SPACE,
.bit1_mark = IRDA_SIRC_BIT1_MARK,
.bit1_space = IRDA_SIRC_BIT1_SPACE,
.bit0_mark = IRDA_SIRC_BIT0_MARK,
.bit0_space = IRDA_SIRC_BIT0_SPACE,
.preamble_tolerance = IRDA_SIRC_PREAMBLE_TOLERANCE,
.bit_tolerance = IRDA_SIRC_BIT_TOLERANCE,
.silence_time = IRDA_SIRC_SILENCE,
.min_split_time = IRDA_SIRC_MIN_SPLIT_TIME,
},
.databit_len[0] = 20,
.databit_len[1] = 15,
.databit_len[2] = 12,
@@ -107,4 +115,3 @@ const IrdaCommonProtocolSpec protocol_sirc = {
.decode_repeat = NULL,
.encode_repeat = irda_encoder_sirc_encode_repeat,
};