[PCF7930] Refactoring & bugfix in READING

firs commit of a few to come.
First renames of variables, added a few comments to improve clarity.
Fixed types (int -> unitx_t , const, ...) - not all. still some to come

Fixed 2 conditions that did not work properly. Here some explanation:

  Imagine dest[i-1] = 255 and dest[i] = 0. THis would mean a clear falling edge.
  However, this code would not work, since dest[i] > lmax is not true.
  This condition only works if I have at least 1 sample between lmax and 255.
  Same for the other way around.
This commit is contained in:
tinooo 2025-02-10 22:41:01 +02:00 committed by Tino
commit 3a8dc89dca
2 changed files with 115 additions and 48 deletions

View file

@ -18,6 +18,13 @@
#include "common.h"
typedef enum{
UNDEFINED,
FALLING,
RISING
} EdgeType;
size_t DemodPCF7931(uint8_t **outBlocks, bool ledcontrol);
bool IsBlock0PCF7931(uint8_t *block);
bool IsBlock1PCF7931(const uint8_t *block);