mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Fixed initialisation problem with LED_STRIP.
This commit is contained in:
parent
760300b562
commit
9f8cafbf8b
8 changed files with 64 additions and 73 deletions
|
@ -393,4 +393,5 @@ uint8_t getRssiPercent(void) { return 0; }
|
|||
|
||||
bool isFlipOverAfterCrashActive(void) { return false; }
|
||||
|
||||
void ws2811LedStripEnable(void) { }
|
||||
}
|
||||
|
|
|
@ -31,23 +31,15 @@ extern "C" {
|
|||
#include "gtest/gtest.h"
|
||||
|
||||
extern "C" {
|
||||
STATIC_UNIT_TESTED extern uint16_t dmaBufferOffset;
|
||||
|
||||
STATIC_UNIT_TESTED void updateLEDDMABuffer(rgbColor24bpp_t *color);
|
||||
void updateLEDDMABuffer(ledStripFormatRGB_e ledFormat, rgbColor24bpp_t *color, unsigned ledIndex);
|
||||
}
|
||||
|
||||
TEST(WS2812, updateDMABuffer) {
|
||||
// given
|
||||
rgbColor24bpp_t color1 = { .raw = {0xFF,0xAA,0x55} };
|
||||
|
||||
// and
|
||||
dmaBufferOffset = 0;
|
||||
|
||||
// when
|
||||
updateLEDDMABuffer(&color1);
|
||||
|
||||
// then
|
||||
EXPECT_EQ(24, dmaBufferOffset);
|
||||
updateLEDDMABuffer(LED_GRB, &color1, 0);
|
||||
|
||||
// and
|
||||
uint8_t byteIndex = 0;
|
||||
|
@ -89,8 +81,10 @@ rgbColor24bpp_t* hsvToRgb24(const hsvColor_t *c) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void ws2811LedStripHardwareInit(ioTag_t ioTag) {
|
||||
bool ws2811LedStripHardwareInit(ioTag_t ioTag) {
|
||||
UNUSED(ioTag);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ws2811LedStripDMAEnable(void) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue