summaryrefslogtreecommitdiff
path: root/SPI.c
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2024-02-01 01:21:26 -0600
committerJoshua Drake <joshua.ellis.drake@gmail.com>2024-02-01 01:21:26 -0600
commit4f975a707e8fe5c6d7dd01babd275b9c1d270251 (patch)
tree2254ec9e63413b6502b05df1f40bed92e27a566c /SPI.c
parentfdd6a8d9a9a8a8df0a4f5d75eef428e9f7f1ab22 (diff)
Board Ready for Testing.
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;