summaryrefslogtreecommitdiff
path: root/SPI.c
diff options
context:
space:
mode:
Diffstat (limited to 'SPI.c')
-rw-r--r--SPI.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/SPI.c b/SPI.c
index 51231fd..46c31bc 100644
--- a/SPI.c
+++ b/SPI.c
@@ -64,9 +64,6 @@
void Message_INST(void)
{
WriteBuffer[0] = WriteBuffer[2] = WriteBuffer[4] = 0x46;
- WriteBuffer[1] = outputs[0];
- WriteBuffer[3] = outputs[1];
- WriteBuffer[5] = outputs[2];
}
void Message_DAGIOL(uint8_t outputs[3])
@@ -80,17 +77,11 @@
void Message_DAGOSM(void)
{
WriteBuffer[0] = WriteBuffer[2] = WriteBuffer[4] = 0x49;
- WriteBuffer[1] = outputs[0];
- WriteBuffer[3] = outputs[1];
- WriteBuffer[5] = outputs[2];
}
void Message_DAGOLON(void)
{
WriteBuffer[0] = WriteBuffer[2] = WriteBuffer[4] = 0x4A;
- WriteBuffer[1] = outputs[0];
- WriteBuffer[3] = outputs[1];
- WriteBuffer[5] = outputs[2];
}
void Message_DAGOLONEN(uint8_t outputs[3])
@@ -128,9 +119,9 @@
void Message_PWMCR0(uint16_t outputs[3])
{
WriteBuffer[0] = WriteBuffer[2] = WriteBuffer[4] = (write << 8) | (!write << 7) | (0b00010000);
- WriteBuffer[0] |= ((outputs[0] << 6) >> 14;
- WriteBuffer[2] |= ((outputs[1] << 6) >> 14;
- WriteBuffer[4] |= ((outputs[3] << 6) >> 14;
+ WriteBuffer[0] |= (outputs[0] << 6) >> 14;
+ WriteBuffer[2] |= (outputs[1] << 6) >> 14;
+ WriteBuffer[4] |= (outputs[3] << 6) >> 14;
WriteBuffer[1] = (outputs[0] << 8) >> 8;
WriteBuffer[3] = (outputs[1] << 8) >> 8;
WriteBuffer[5] = (outputs[2] << 8) >> 8;
@@ -139,9 +130,9 @@
void Message_PWMCR1(uint16_t outputs[3])
{
WriteBuffer[0] = WriteBuffer[2] = WriteBuffer[4] = (write << 8) | (!write << 7) | (0b00010100);
- WriteBuffer[0] |= ((outputs[0] << 6) >> 14;
- WriteBuffer[2] |= ((outputs[1] << 6) >> 14;
- WriteBuffer[4] |= ((outputs[3] << 6) >> 14;
+ WriteBuffer[0] |= (outputs[0] << 6) >> 14;
+ WriteBuffer[2] |= (outputs[1] << 6) >> 14;
+ WriteBuffer[4] |= (outputs[3] << 6) >> 14;
WriteBuffer[1] = (outputs[0] << 8) >> 8;
WriteBuffer[3] = (outputs[1] << 8) >> 8;
WriteBuffer[5] = (outputs[2] << 8) >> 8;