Hmm,

 

I changed the quigg_switch.c code accordingly, and removed the definition for QUIGG_PULSE_LOW in quigg_switch.h , as it currently not modifying anything

I kept the definitions in the header file as they are used to initialize the protocol_t *quigg_switch structure as requested and would like to see all others doing it as well.

The reason for this is that I am a strong believer of defining constant values not hidden deep in program code by using numerical values but  to define those parameters at the same location where the structure itself is defined using symbolic expressions and to make use of those symbolic expressions (as with PULSE_DIV).

 

Wolfgang

Change is available with commit 19a3a82

 

Von: CurlyMoo [mailto:notifications@github.com] 
Gesendet: Samstag, 26. April 2014 10:36
An: pilight/pilight
Cc: wo-rasp
Betreff: Re: [pilight] Bug fix of QUIGG protocol: learning mode, id range 0...4095 (#96)

 

In libs/protocols/quigg_switch.h:

> @@ -19,6 +19,13 @@
>  #ifndef _PROTOCOL_QUIGG_SWITCH_H_
>  #define _PROTOCOL_QUIGG_SWITCH_H_
>  
> +#define QUIGG_BINLEN               21
> +#define QUIGG_PULSE_HIGH    2
> +#define QUIGG_PULSE_LENGTH  700
> +#define QUIGG_PULSE_LOW            1
> +#define QUIGG_PULSE_LSB            0
> +#define QUIGG_RAWLEN               42

Can you not do this. Just refer to all these values by using quiqq_switch->pulse inside the protocol functions.

—
Reply to this email directly or view it on GitHub <https://github.com/pilight/pilight/pull/96/files#r12023682> .  <https://github.com/notifications/beacon/7294039__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNDEyMDU1MSwiZGF0YSI6eyJpZCI6MzA2NzA3Nzl9fQ==--1bcb32be0000193cb4eeb30cc37b1b2bef6ede00.gif>