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

@@ -20,21 +20,21 @@
*
***************************************************************************************************/
#define IRDA_NEC_PREAMBLE_MARK 9000
#define IRDA_NEC_PREAMBLE_SPACE 4500
#define IRDA_NEC_BIT1_MARK 560
#define IRDA_NEC_BIT1_SPACE 1690
#define IRDA_NEC_BIT0_MARK 560
#define IRDA_NEC_BIT0_SPACE 560
#define IRDA_NEC_REPEAT_PERIOD 110000
#define IRDA_NEC_SILENCE IRDA_NEC_REPEAT_PERIOD
#define IRDA_NEC_MIN_SPLIT_TIME IRDA_NEC_REPEAT_PAUSE_MIN
#define IRDA_NEC_REPEAT_PAUSE_MIN 4000
#define IRDA_NEC_REPEAT_PAUSE_MAX 150000
#define IRDA_NEC_REPEAT_MARK 9000
#define IRDA_NEC_REPEAT_SPACE 2250
#define IRDA_NEC_PREAMBLE_TOLERANCE 200 // us
#define IRDA_NEC_BIT_TOLERANCE 120 // us
#define IRDA_NEC_PREAMBLE_MARK 9000
#define IRDA_NEC_PREAMBLE_SPACE 4500
#define IRDA_NEC_BIT1_MARK 560
#define IRDA_NEC_BIT1_SPACE 1690
#define IRDA_NEC_BIT0_MARK 560
#define IRDA_NEC_BIT0_SPACE 560
#define IRDA_NEC_REPEAT_PERIOD 110000
#define IRDA_NEC_SILENCE IRDA_NEC_REPEAT_PERIOD
#define IRDA_NEC_MIN_SPLIT_TIME IRDA_NEC_REPEAT_PAUSE_MIN
#define IRDA_NEC_REPEAT_PAUSE_MIN 4000
#define IRDA_NEC_REPEAT_PAUSE_MAX 150000
#define IRDA_NEC_REPEAT_MARK 9000
#define IRDA_NEC_REPEAT_SPACE 2250
#define IRDA_NEC_PREAMBLE_TOLERANCE 200 // us
#define IRDA_NEC_BIT_TOLERANCE 120 // us
void* irda_decoder_nec_alloc(void);
void irda_decoder_nec_reset(void* decoder);
@@ -47,12 +47,12 @@ void irda_encoder_nec_reset(void* encoder_ptr, const IrdaMessage* message);
void irda_encoder_nec_free(void* encoder_ptr);
bool irda_decoder_nec_interpret(IrdaCommonDecoder* decoder);
IrdaStatus irda_decoder_nec_decode_repeat(IrdaCommonDecoder* decoder);
IrdaStatus irda_encoder_nec_encode_repeat(IrdaCommonEncoder* encoder, uint32_t* duration, bool* level);
IrdaStatus
irda_encoder_nec_encode_repeat(IrdaCommonEncoder* encoder, uint32_t* duration, bool* level);
const IrdaProtocolSpecification* irda_nec_get_spec(IrdaProtocol protocol);
extern const IrdaCommonProtocolSpec protocol_nec;
/***************************************************************************************************
* SAMSUNG32 protocol description
* https://www.mikrocontroller.net/articles/IRMP_-_english#SAMSUNG
@@ -67,27 +67,27 @@ extern const IrdaCommonProtocolSpec protocol_nec;
*
***************************************************************************************************/
#define IRDA_SAMSUNG_PREAMBLE_MARK 4500
#define IRDA_SAMSUNG_PREAMBLE_SPACE 4500
#define IRDA_SAMSUNG_BIT1_MARK 550
#define IRDA_SAMSUNG_BIT1_SPACE 1650
#define IRDA_SAMSUNG_BIT0_MARK 550
#define IRDA_SAMSUNG_BIT0_SPACE 550
#define IRDA_SAMSUNG_REPEAT_PAUSE_MIN 30000
#define IRDA_SAMSUNG_REPEAT_PAUSE1 46000
#define IRDA_SAMSUNG_REPEAT_PAUSE2 97000
#define IRDA_SAMSUNG_PREAMBLE_MARK 4500
#define IRDA_SAMSUNG_PREAMBLE_SPACE 4500
#define IRDA_SAMSUNG_BIT1_MARK 550
#define IRDA_SAMSUNG_BIT1_SPACE 1650
#define IRDA_SAMSUNG_BIT0_MARK 550
#define IRDA_SAMSUNG_BIT0_SPACE 550
#define IRDA_SAMSUNG_REPEAT_PAUSE_MIN 30000
#define IRDA_SAMSUNG_REPEAT_PAUSE1 46000
#define IRDA_SAMSUNG_REPEAT_PAUSE2 97000
/* Samsung silence have to be greater than REPEAT MAX
* otherwise there can be problems during unit tests parsing
* of some data. Real tolerances we don't know, but in real life
* silence time should be greater than max repeat time. This is
* because of similar preambule timings for repeat and first messages. */
#define IRDA_SAMSUNG_MIN_SPLIT_TIME 5000
#define IRDA_SAMSUNG_SILENCE 145000
#define IRDA_SAMSUNG_REPEAT_PAUSE_MAX 140000
#define IRDA_SAMSUNG_REPEAT_MARK 4500
#define IRDA_SAMSUNG_REPEAT_SPACE 4500
#define IRDA_SAMSUNG_PREAMBLE_TOLERANCE 200 // us
#define IRDA_SAMSUNG_BIT_TOLERANCE 120 // us
#define IRDA_SAMSUNG_MIN_SPLIT_TIME 5000
#define IRDA_SAMSUNG_SILENCE 145000
#define IRDA_SAMSUNG_REPEAT_PAUSE_MAX 140000
#define IRDA_SAMSUNG_REPEAT_MARK 4500
#define IRDA_SAMSUNG_REPEAT_SPACE 4500
#define IRDA_SAMSUNG_PREAMBLE_TOLERANCE 200 // us
#define IRDA_SAMSUNG_BIT_TOLERANCE 120 // us
void* irda_decoder_samsung32_alloc(void);
void irda_decoder_samsung32_reset(void* decoder);
@@ -100,12 +100,14 @@ void* irda_encoder_samsung32_alloc(void);
void irda_encoder_samsung32_free(void* encoder_ptr);
bool irda_decoder_samsung32_interpret(IrdaCommonDecoder* decoder);
IrdaStatus irda_decoder_samsung32_decode_repeat(IrdaCommonDecoder* decoder);
IrdaStatus irda_encoder_samsung32_encode_repeat(IrdaCommonEncoder* encoder, uint32_t* duration, bool* level);
IrdaStatus irda_encoder_samsung32_encode_repeat(
IrdaCommonEncoder* encoder,
uint32_t* duration,
bool* level);
const IrdaProtocolSpecification* irda_samsung32_get_spec(IrdaProtocol protocol);
extern const IrdaCommonProtocolSpec protocol_samsung32;
/***************************************************************************************************
* RC6 protocol description
* https://www.mikrocontroller.net/articles/IRMP_-_english#RC6_.2B_RC6A
@@ -127,17 +129,17 @@ extern const IrdaCommonProtocolSpec protocol_samsung32;
* command - 8 bit
***************************************************************************************************/
#define IRDA_RC6_CARRIER_FREQUENCY 36000
#define IRDA_RC6_DUTY_CYCLE 0.33
#define IRDA_RC6_CARRIER_FREQUENCY 36000
#define IRDA_RC6_DUTY_CYCLE 0.33
#define IRDA_RC6_PREAMBLE_MARK 2666
#define IRDA_RC6_PREAMBLE_SPACE 889
#define IRDA_RC6_BIT 444 // half of time-quant for 1 bit
#define IRDA_RC6_PREAMBLE_TOLERANCE 200 // us
#define IRDA_RC6_BIT_TOLERANCE 120 // us
#define IRDA_RC6_PREAMBLE_MARK 2666
#define IRDA_RC6_PREAMBLE_SPACE 889
#define IRDA_RC6_BIT 444 // half of time-quant for 1 bit
#define IRDA_RC6_PREAMBLE_TOLERANCE 200 // us
#define IRDA_RC6_BIT_TOLERANCE 120 // us
/* protocol allows 2700 silence, but it is hard to send 1 message without repeat */
#define IRDA_RC6_SILENCE (2700 * 10)
#define IRDA_RC6_MIN_SPLIT_TIME 2700
#define IRDA_RC6_SILENCE (2700 * 10)
#define IRDA_RC6_MIN_SPLIT_TIME 2700
void* irda_decoder_rc6_alloc(void);
void irda_decoder_rc6_reset(void* decoder);
@@ -149,13 +151,16 @@ void irda_encoder_rc6_reset(void* encoder_ptr, const IrdaMessage* message);
void irda_encoder_rc6_free(void* decoder);
IrdaStatus irda_encoder_rc6_encode(void* encoder_ptr, uint32_t* duration, bool* polarity);
bool irda_decoder_rc6_interpret(IrdaCommonDecoder* decoder);
IrdaStatus irda_decoder_rc6_decode_manchester(IrdaCommonDecoder* decoder, bool level, uint32_t timing);
IrdaStatus irda_encoder_rc6_encode_manchester(IrdaCommonEncoder* encoder_ptr, uint32_t* duration, bool* polarity);
IrdaStatus
irda_decoder_rc6_decode_manchester(IrdaCommonDecoder* decoder, bool level, uint32_t timing);
IrdaStatus irda_encoder_rc6_encode_manchester(
IrdaCommonEncoder* encoder_ptr,
uint32_t* duration,
bool* polarity);
const IrdaProtocolSpecification* irda_rc6_get_spec(IrdaProtocol protocol);
extern const IrdaCommonProtocolSpec protocol_rc6;
/***************************************************************************************************
* RC5 protocol description
* https://www.mikrocontroller.net/articles/IRMP_-_english#RC5_.2B_RC5X
@@ -178,17 +183,17 @@ extern const IrdaCommonProtocolSpec protocol_rc6;
* command - 6/7 bit
***************************************************************************************************/
#define IRDA_RC5_CARRIER_FREQUENCY 36000
#define IRDA_RC5_DUTY_CYCLE 0.33
#define IRDA_RC5_CARRIER_FREQUENCY 36000
#define IRDA_RC5_DUTY_CYCLE 0.33
#define IRDA_RC5_PREAMBLE_MARK 0
#define IRDA_RC5_PREAMBLE_SPACE 0
#define IRDA_RC5_BIT 888 // half of time-quant for 1 bit
#define IRDA_RC5_PREAMBLE_TOLERANCE 200 // us
#define IRDA_RC5_BIT_TOLERANCE 120 // us
#define IRDA_RC5_PREAMBLE_MARK 0
#define IRDA_RC5_PREAMBLE_SPACE 0
#define IRDA_RC5_BIT 888 // half of time-quant for 1 bit
#define IRDA_RC5_PREAMBLE_TOLERANCE 200 // us
#define IRDA_RC5_BIT_TOLERANCE 120 // us
/* protocol allows 2700 silence, but it is hard to send 1 message without repeat */
#define IRDA_RC5_SILENCE (2700 * 10)
#define IRDA_RC5_MIN_SPLIT_TIME 2700
#define IRDA_RC5_SILENCE (2700 * 10)
#define IRDA_RC5_MIN_SPLIT_TIME 2700
void* irda_decoder_rc5_alloc(void);
void irda_decoder_rc5_reset(void* decoder);
@@ -204,7 +209,6 @@ const IrdaProtocolSpecification* irda_rc5_get_spec(IrdaProtocol protocol);
extern const IrdaCommonProtocolSpec protocol_rc5;
/***************************************************************************************************
* Sony SIRC protocol description
* https://www.sbprojects.net/knowledge/ir/sirc.php
@@ -226,20 +230,19 @@ extern const IrdaCommonProtocolSpec protocol_rc5;
* Assume 8 last extended bits for SIRC20 are address bits.
***************************************************************************************************/
#define IRDA_SIRC_CARRIER_FREQUENCY 40000
#define IRDA_SIRC_DUTY_CYCLE 0.33
#define IRDA_SIRC_PREAMBLE_MARK 2400
#define IRDA_SIRC_PREAMBLE_SPACE 600
#define IRDA_SIRC_BIT1_MARK 1200
#define IRDA_SIRC_BIT1_SPACE 600
#define IRDA_SIRC_BIT0_MARK 600
#define IRDA_SIRC_BIT0_SPACE 600
#define IRDA_SIRC_PREAMBLE_TOLERANCE 200 // us
#define IRDA_SIRC_BIT_TOLERANCE 120 // us
#define IRDA_SIRC_SILENCE 10000
#define IRDA_SIRC_MIN_SPLIT_TIME (IRDA_SIRC_SILENCE - 1000)
#define IRDA_SIRC_REPEAT_PERIOD 45000
#define IRDA_SIRC_CARRIER_FREQUENCY 40000
#define IRDA_SIRC_DUTY_CYCLE 0.33
#define IRDA_SIRC_PREAMBLE_MARK 2400
#define IRDA_SIRC_PREAMBLE_SPACE 600
#define IRDA_SIRC_BIT1_MARK 1200
#define IRDA_SIRC_BIT1_SPACE 600
#define IRDA_SIRC_BIT0_MARK 600
#define IRDA_SIRC_BIT0_SPACE 600
#define IRDA_SIRC_PREAMBLE_TOLERANCE 200 // us
#define IRDA_SIRC_BIT_TOLERANCE 120 // us
#define IRDA_SIRC_SILENCE 10000
#define IRDA_SIRC_MIN_SPLIT_TIME (IRDA_SIRC_SILENCE - 1000)
#define IRDA_SIRC_REPEAT_PERIOD 45000
void* irda_decoder_sirc_alloc(void);
void irda_decoder_sirc_reset(void* decoder);
@@ -253,7 +256,7 @@ void irda_encoder_sirc_free(void* decoder);
IrdaStatus irda_encoder_sirc_encode(void* encoder_ptr, uint32_t* duration, bool* polarity);
bool irda_decoder_sirc_interpret(IrdaCommonDecoder* decoder);
const IrdaProtocolSpecification* irda_sirc_get_spec(IrdaProtocol protocol);
IrdaStatus irda_encoder_sirc_encode_repeat(IrdaCommonEncoder* encoder, uint32_t* duration, bool* level);
IrdaStatus
irda_encoder_sirc_encode_repeat(IrdaCommonEncoder* encoder, uint32_t* duration, bool* level);
extern const IrdaCommonProtocolSpec protocol_sirc;