Skip to content

Commit d61f951

Browse files
github-actions[bot]dchansen06
authored andcommitted
Automatic Clang-Format: Standardized formatting automatically
1 parent 93846ae commit d61f951

3 files changed

Lines changed: 29 additions & 27 deletions

File tree

G4NEOTESTING/Core/Src/main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
#include "dma.h"
2424
#include "fdcan.h"
2525
#include "gpio.h"
26+
#include "gr_neopixel.h"
2627
#include "i2c.h"
2728
#include "spi.h"
2829
#include "tim.h"
2930
#include "usart.h"
3031

31-
#include "gr_neopixel.h"
32-
3332
/* Private includes ----------------------------------------------------------*/
3433
/* USER CODE BEGIN Includes */
3534

@@ -121,8 +120,8 @@ int main(void)
121120
HAL_Delay(1000);
122121

123122
/* USER CODE BEGIN 3 */
124-
Neopixel_update();
125-
}
123+
Neopixel_update();
124+
}
126125
}
127126

128127
/**

Lib/FancyLayers-RENAME/NeoPixel/Inc/gr_neopixel.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
#include <stdint.h>
77

88
typedef enum {
9-
COLOR_GREEN = (uint32_t)0xFF0000,
10-
COLOR_RED = (uint32_t)0x03FC00,
11-
COLOR_BLUE = (uint32_t)0x0000FF,
9+
COLOR_GREEN = (uint32_t)0xFF0000,
10+
COLOR_RED = (uint32_t)0x03FC00,
11+
COLOR_BLUE = (uint32_t)0x0000FF,
1212
} Color;
1313

1414
typedef union {
15-
struct {
16-
Color TS_Active;
17-
Color RTD;
18-
};
15+
struct {
16+
Color TS_Active;
17+
Color RTD;
18+
};
1919

20-
uint32_t rawData[2];
20+
uint32_t rawData[2];
2121
} NeoPixelData;
2222

2323
void Neopixel_update();
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
#include "gr_neopixel.h"
2-
#include "main.h"
3-
#include "spi.h"
2+
43
#include <stdbool.h>
54
#include <stdint.h>
65

7-
void Neopixel_update() {
6+
#include "main.h"
7+
#include "spi.h"
8+
9+
void Neopixel_update()
10+
{
811

9-
NeoPixelData globalNeoPixelData = {0};
12+
NeoPixelData globalNeoPixelData = {0};
1013

11-
// temp color set
12-
globalNeoPixelData.RTD = COLOR_BLUE;
13-
globalNeoPixelData.TS_Active = COLOR_BLUE;
14+
// temp color set
15+
globalNeoPixelData.RTD = COLOR_BLUE;
16+
globalNeoPixelData.TS_Active = COLOR_BLUE;
1417

15-
uint8_t neopixelTransmission[48];
16-
for (int i = 0; i < 2; i++) {
17-
for (int j = 23; j >= 0; j--) {
18-
neopixelTransmission[i * 24 + 23 - j] = 0x4 + ((globalNeoPixelData.rawData[i] >> j) & 0x1 << 1); // 0x06 is high, 0x04 is low
19-
}
20-
}
18+
uint8_t neopixelTransmission[48];
19+
for (int i = 0; i < 2; i++) {
20+
for (int j = 23; j >= 0; j--) {
21+
neopixelTransmission[i * 24 + 23 - j] = 0x4 + ((globalNeoPixelData.rawData[i] >> j) & 0x1 << 1); // 0x06 is high, 0x04 is low
22+
}
23+
}
2124

22-
//might need to iterate through array and send each bit individually
23-
LL_SPI_TransmitData8(SPI1, neopixelTransmission);
25+
// might need to iterate through array and send each bit individually
26+
LL_SPI_TransmitData8(SPI1, neopixelTransmission);
2427
}

0 commit comments

Comments
 (0)