* optimisation: -C3 compiler flag for optimised size

* bugfix: correct order of setting `DDRn` and `PORTn`
* optimisation: `enum` and `static const` instead of macros
* optimisation: `PT6302_startup` is now `inline`
* optimisation: functions are now static
* bugfix: `data` is now rotated and stored instead of just rotating
* special thanks to @kissadamfkut for pointing all of this out to me
This commit is contained in:
2022-03-02 23:47:26 +01:00
parent 69c4eb43e0
commit 60a7b1309e
4 changed files with 60 additions and 55 deletions

View File

@@ -5,17 +5,6 @@
#ifndef _PT6302_H_
#define _PT6302_H_
/* PT6302 timing constants, all in usec */
#define TCW 1 //CLKB pulse width
#define TDOFF 8 //Data processing time
#define DTCSH 16 //time difference between tDOFF and tCSH
#define TPRZ 100 //VDD rise time
#define TWRSTB 1 //RSTB pulse width
#define RSTpin (uint8_t) (1 << PC2)
#define CSBpin (uint8_t) (1 << PB0)
#define CLKBpin (uint8_t) (1 << PB6)
#define DINpin (uint8_t) (1 << PB7)
/* -------------------------------------------------------------