reformat in uvostyle

This commit is contained in:
2022-04-12 00:36:58 +02:00
parent 00ca1d6f03
commit 4aca3c3a11
22 changed files with 1260 additions and 1234 deletions

View File

@ -5,22 +5,25 @@
inline void writePin(volatile unsigned char *port, const unsigned char pin, const bool state) //waste 2 cycles
{
*port &= ~(1 << pin);
if(state) *port |= (1 << pin);
*port &= ~(1 << pin);
if(state) *port |= (1 << pin);
}
inline void setBit( volatile unsigned char *reg, const unsigned char bit, bool value )
{
writePin(reg, bit, value);
writePin(reg, bit, value);
}
inline void setDirection( volatile unsigned char *portDirReg, const unsigned char pin, bool makeOutput )
{
writePin(portDirReg, pin, makeOutput);
writePin(portDirReg, pin, makeOutput);
}
inline bool readPin( volatile unsigned char *inPort, const unsigned char pin){ return (bool) (*inPort & (1 << pin));}
inline bool readPin( volatile unsigned char *inPort, const unsigned char pin)
{
return (bool) (*inPort & (1 << pin));
}
#endif