code formating changes
This commit is contained in:
11
main.cpp
11
main.cpp
@ -125,13 +125,15 @@ void itemDispatch(SVector<Item, MAX_ITEMS>* items, Pwm16b* auxPwm, char* token,
|
|||||||
Item item;
|
Item item;
|
||||||
item.id = id;
|
item.id = id;
|
||||||
item.type = type;
|
item.type = type;
|
||||||
if( token != NULL ) item.setName(token);
|
if( token != NULL )
|
||||||
|
item.setName(token);
|
||||||
items->push_back(item);
|
items->push_back(item);
|
||||||
writeItemState(serial, &items->back(), items->count()-1);
|
writeItemState(serial, &items->back(), items->count()-1);
|
||||||
}
|
}
|
||||||
else if(items->remainingCapacity() == 0) serial->write_p(PSTR("Relay storage full.\n"));
|
else if(items->remainingCapacity() == 0)
|
||||||
else serial->write_p(
|
serial->write_p(PSTR("Relay storage full.\n"));
|
||||||
PSTR("Usage: item add [id] [type] [name]\n [id] being a 16bit binary nummber and [name] an optional string\n"));
|
else
|
||||||
|
serial->write_p(PSTR("Usage: item add [id] [type] [name]\n [id] being a 16bit binary nummber and [name] an optional string\n"));
|
||||||
}
|
}
|
||||||
else if(strcmp(token, "delete") == 0)
|
else if(strcmp(token, "delete") == 0)
|
||||||
{
|
{
|
||||||
@ -457,7 +459,6 @@ int main()
|
|||||||
W433DataTransmitter transmitter(&PORTB, PB5);
|
W433DataTransmitter transmitter(&PORTB, PB5);
|
||||||
UvosItem::transmitter = &transmitter;
|
UvosItem::transmitter = &transmitter;
|
||||||
|
|
||||||
|
|
||||||
serial.write_p(PSTR("RGBController v1.5 starting\n"));
|
serial.write_p(PSTR("RGBController v1.5 starting\n"));
|
||||||
|
|
||||||
load();
|
load();
|
||||||
|
@ -15,7 +15,8 @@ UvosItem::UvosItem(const Item& item)
|
|||||||
void UvosItem::setValue(const uint8_t value)
|
void UvosItem::setValue(const uint8_t value)
|
||||||
{
|
{
|
||||||
const uint8_t paket[4] = {id >> 8, id & 0x00FF, 0, value};
|
const uint8_t paket[4] = {id >> 8, id & 0x00FF, 0, value};
|
||||||
if(transmitter)transmitter->send(paket, 4);
|
if(transmitter)
|
||||||
|
transmitter->send(paket, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UvosItem::resend()
|
void UvosItem::resend()
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
#define WRITEPIN_H
|
#define WRITEPIN_H
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||||
inline void writePin(volatile unsigned char *port, const unsigned char pin, const bool state) //waste 2 cycles
|
inline void writePin(volatile unsigned char *port, const unsigned char pin, const bool state) //waste 2 cycles
|
||||||
{
|
{
|
||||||
*port &= ~(1 << pin);
|
*port &= ~(1 << pin);
|
||||||
@ -24,6 +25,6 @@ inline bool readPin( volatile unsigned char *inPort, const unsigned char pin)
|
|||||||
{
|
{
|
||||||
return (bool) (*inPort & (1 << pin));
|
return (bool) (*inPort & (1 << pin));
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user