mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
On top updates
This commit is contained in:
parent
49b44089e7
commit
6f3f721c26
@ -161,7 +161,7 @@
|
||||
"conf_leds_note_layout_overwrite": "Note: Overwrite creates a default layout for {{plural:$1| one LED| all $1 LEDs}} given by the hardware LED count",
|
||||
"conf_leds_optgroup_RPiGPIO": "RPi GPIO",
|
||||
"conf_leds_optgroup_RPiPWM": "RPi PWM",
|
||||
"conf_leds_optgroup_RPiSPI": "RPi SPI",
|
||||
"conf_leds_optgroup_SPI": "SPI",
|
||||
"conf_leds_optgroup_debug": "Debug",
|
||||
"conf_leds_optgroup_network": "Network",
|
||||
"conf_leds_optgroup_other": "Other",
|
||||
|
@ -18,7 +18,7 @@ var bottomRight2bottomLeft = null;
|
||||
var bottomLeft2topLeft = null;
|
||||
var toggleKeystoneCorrectionArea = false;
|
||||
|
||||
var devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'sk9822', 'ws2812spi'];
|
||||
var devSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'sk9822', 'ws2812spi'];
|
||||
var devFTDI = ['apa102_ftdi', 'sk6812_ftdi', 'ws2812_ftdi'];
|
||||
var devRPiPWM = ['ws281x'];
|
||||
var devRPiGPIO = ['piblaster'];
|
||||
@ -1671,7 +1671,7 @@ $(document).ready(function () {
|
||||
optArr[6] = [];
|
||||
|
||||
for (var idx = 0; idx < ledDevices.length; idx++) {
|
||||
if ($.inArray(ledDevices[idx], devRPiSPI) != -1)
|
||||
if ($.inArray(ledDevices[idx], devSPI) != -1)
|
||||
optArr[0].push(ledDevices[idx]);
|
||||
else if ($.inArray(ledDevices[idx], devRPiPWM) != -1)
|
||||
optArr[1].push(ledDevices[idx]);
|
||||
@ -1958,8 +1958,8 @@ var updateOutputSelectList = function (ledType, discoveryInfo) {
|
||||
ledTypeGroup = "devNET";
|
||||
} else if ($.inArray(ledType, devSerial) != -1) {
|
||||
ledTypeGroup = "devSerial";
|
||||
} else if ($.inArray(ledType, devRPiSPI) != -1) {
|
||||
ledTypeGroup = "devRPiSPI";
|
||||
} else if ($.inArray(ledType, devSPI) != -1) {
|
||||
ledTypeGroup = "devSPI";
|
||||
} else if ($.inArray(ledType, devFTDI) != -1) {
|
||||
ledTypeGroup = "devFTDI";
|
||||
} else if ($.inArray(ledType, devRPiGPIO) != -1) {
|
||||
@ -2140,7 +2140,7 @@ var updateOutputSelectList = function (ledType, discoveryInfo) {
|
||||
}
|
||||
break;
|
||||
|
||||
case "devRPiSPI":
|
||||
case "devSPI":
|
||||
case "devRPiGPIO":
|
||||
key = "output";
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
LedDeviceSk6812_ftdi::LedDeviceSk6812_ftdi(const QJsonObject &deviceConfig)
|
||||
: ProviderFtdi(deviceConfig),
|
||||
_whiteAlgorithm(RGBW::WhiteAlgorithm::INVALID),
|
||||
SPI_BYTES_PER_COLOUR(4),
|
||||
bitpair_to_byte{
|
||||
0b10001000,
|
||||
@ -31,6 +32,14 @@ bool LedDeviceSk6812_ftdi::init(const QJsonObject &deviceConfig)
|
||||
QString whiteAlgorithm = deviceConfig["whiteAlgorithm"].toString("white_off");
|
||||
|
||||
_whiteAlgorithm = RGBW::stringToWhiteAlgorithm(whiteAlgorithm);
|
||||
if (_whiteAlgorithm == RGBW::WhiteAlgorithm::INVALID)
|
||||
{
|
||||
QString errortext = QString ("unknown whiteAlgorithm: %1").arg(whiteAlgorithm);
|
||||
this->setInError(errortext);
|
||||
isInitOK = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Debug(_log, "whiteAlgorithm : %s", QSTRING_CSTR(whiteAlgorithm));
|
||||
|
||||
@ -41,6 +50,7 @@ bool LedDeviceSk6812_ftdi::init(const QJsonObject &deviceConfig)
|
||||
|
||||
isInitOK = true;
|
||||
}
|
||||
}
|
||||
return isInitOK;
|
||||
}
|
||||
|
||||
|
@ -22,9 +22,9 @@ namespace Pin
|
||||
};
|
||||
}
|
||||
|
||||
const unsigned char pinInitialState = Pin::CS;
|
||||
const uint8_t pinInitialState = Pin::CS;
|
||||
// Use these pins as outputs
|
||||
const unsigned char pinDirection = Pin::SK | Pin::DO | Pin::CS;
|
||||
const uint8_t pinDirection = Pin::SK | Pin::DO | Pin::CS;
|
||||
|
||||
const QString ProviderFtdi::AUTO_SETTING = QString("auto");
|
||||
|
||||
@ -58,6 +58,13 @@ int ProviderFtdi::open()
|
||||
|
||||
_ftdic = ftdi_new();
|
||||
|
||||
if (ftdi_init(_ftdic) < 0)
|
||||
{
|
||||
_ftdic = nullptr;
|
||||
setInError("Could not initialize the ftdi library");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Debug(_log, "Opening FTDI device=%s", QSTRING_CSTR(_deviceName));
|
||||
|
||||
FTDI_CHECK_RESULT((rc = ftdi_usb_open_string(_ftdic, QSTRING_CSTR(_deviceName))) < 0);
|
||||
@ -67,7 +74,6 @@ int ProviderFtdi::open()
|
||||
FTDI_CHECK_RESULT((rc = ftdi_set_bitmode(_ftdic, 0x00, BITMODE_RESET)) < 0);
|
||||
FTDI_CHECK_RESULT((rc = ftdi_set_bitmode(_ftdic, 0xff, BITMODE_MPSSE)) < 0);
|
||||
|
||||
|
||||
double reference_clock = 60e6;
|
||||
int divisor = (reference_clock / 2 / _baudRate_Hz) - 1;
|
||||
std::vector<uint8_t> buf = {
|
||||
@ -119,7 +125,6 @@ int ProviderFtdi::writeBytes(const qint64 size, const uint8_t *data)
|
||||
MPSSE_DO_WRITE | MPSSE_WRITE_NEG,
|
||||
static_cast<unsigned char>(count_arg),
|
||||
static_cast<unsigned char>(count_arg >> 8),
|
||||
// LED's data will be inserted here
|
||||
SET_BITS_LOW,
|
||||
pinInitialState | Pin::CS,
|
||||
pinDirection
|
||||
|
@ -22,10 +22,30 @@
|
||||
"whiteAlgorithm": {
|
||||
"type": "string",
|
||||
"title":"edt_dev_spec_whiteLedAlgor_title",
|
||||
"enum" : ["subtract_minimum","sub_min_cool_adjust","sub_min_warm_adjust","white_off"],
|
||||
"enum" : [
|
||||
"subtract_minimum",
|
||||
"sub_min_cool_adjust",
|
||||
"sub_min_warm_adjust",
|
||||
"cold_white",
|
||||
"neutral_white",
|
||||
"auto",
|
||||
"auto_max",
|
||||
"auto_accurate",
|
||||
"white_off"
|
||||
],
|
||||
"default": "subtract_minimum",
|
||||
"options" : {
|
||||
"enum_titles" : ["edt_dev_enum_subtract_minimum", "edt_dev_enum_sub_min_cool_adjust","edt_dev_enum_sub_min_warm_adjust", "edt_dev_enum_white_off"]
|
||||
"enum_titles" : [
|
||||
"edt_dev_enum_subtract_minimum",
|
||||
"edt_dev_enum_sub_min_cool_adjust",
|
||||
"edt_dev_enum_sub_min_warm_adjust",
|
||||
"edt_dev_enum_cold_white",
|
||||
"edt_dev_enum_neutral_white",
|
||||
"edt_dev_enum_auto",
|
||||
"edt_dev_enum_auto_max",
|
||||
"edt_dev_enum_auto_accurate",
|
||||
"edt_dev_enum_white_off"
|
||||
]
|
||||
},
|
||||
"propertyOrder" : 4
|
||||
},
|
||||
|
@ -43,10 +43,30 @@
|
||||
"whiteAlgorithm": {
|
||||
"type": "string",
|
||||
"title":"edt_dev_spec_whiteLedAlgor_title",
|
||||
"enum" : ["subtract_minimum","sub_min_cool_adjust","sub_min_warm_adjust","white_off"],
|
||||
"enum" : [
|
||||
"subtract_minimum",
|
||||
"sub_min_cool_adjust",
|
||||
"sub_min_warm_adjust",
|
||||
"cold_white",
|
||||
"neutral_white",
|
||||
"auto",
|
||||
"auto_max",
|
||||
"auto_accurate",
|
||||
"white_off"
|
||||
],
|
||||
"default": "subtract_minimum",
|
||||
"options" : {
|
||||
"enum_titles" : ["edt_dev_enum_subtract_minimum", "edt_dev_enum_sub_min_cool_adjust","edt_dev_enum_sub_min_warm_adjust", "edt_dev_enum_white_off"]
|
||||
"enum_titles" : [
|
||||
"edt_dev_enum_subtract_minimum",
|
||||
"edt_dev_enum_sub_min_cool_adjust",
|
||||
"edt_dev_enum_sub_min_warm_adjust",
|
||||
"edt_dev_enum_cold_white",
|
||||
"edt_dev_enum_neutral_white",
|
||||
"edt_dev_enum_auto",
|
||||
"edt_dev_enum_auto_max",
|
||||
"edt_dev_enum_auto_accurate",
|
||||
"edt_dev_enum_white_off"
|
||||
]
|
||||
},
|
||||
"propertyOrder" : 7
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user