mirror of
https://github.com/Hopiu/rpi-rgb-led-matrix.git
synced 2026-03-16 22:10:27 +00:00
o Rename hardware pulsing flag to be disable_hardware_pulsing
instead of allow_hardware_pulsing. A little easier to understand and also reflects 'an off bit is the default'.
This commit is contained in:
parent
fdcaa7d241
commit
2c1df4a5cb
3 changed files with 21 additions and 15 deletions
|
|
@ -91,11 +91,6 @@ public:
|
|||
// Flag: --led-pwm-lsb-nanoseconds
|
||||
int pwm_lsb_nanoseconds;
|
||||
|
||||
// Allow to use the hardware subsystem to create pulses. This won't do
|
||||
// anything if output enable is not connected to GPIO 18.
|
||||
// Flag: --led-hardware-pulse
|
||||
bool allow_hardware_pulsing;
|
||||
|
||||
// The initial brightness of the panel in percent. Valid range is 1..100
|
||||
// Default: 100
|
||||
// Flag: --led-brightness
|
||||
|
|
@ -105,6 +100,14 @@ public:
|
|||
// Flag: --led-scan-mode
|
||||
int scan_mode;
|
||||
|
||||
// Disable the PWM hardware subsystem to create pulses.
|
||||
// Typically, you don't want to disable hardware pulsing, this is mostly
|
||||
// for debugging and figuring out if there is interference with the
|
||||
// sound system.
|
||||
// This won't do anything if output enable is not connected to GPIO 18 in
|
||||
// non-standard wirings.
|
||||
// Flag: --led-hardware-pulse
|
||||
bool disable_hardware_pulsing;
|
||||
bool show_refresh_rate; // Flag: --led-show-refresh
|
||||
bool swap_green_blue; // Flag: --led-swap-green-blue
|
||||
bool inverse_colors; // Flag: --led-inverse
|
||||
|
|
|
|||
|
|
@ -121,12 +121,6 @@ RGBMatrix::Options::Options()
|
|||
pwm_lsb_nanoseconds(130),
|
||||
#endif
|
||||
|
||||
#ifdef DISABLE_HARDWARE_PULSES
|
||||
allow_hardware_pulsing(false),
|
||||
#else
|
||||
allow_hardware_pulsing(true),
|
||||
#endif
|
||||
|
||||
brightness(100),
|
||||
|
||||
#ifdef RGB_SCAN_INTERLACED
|
||||
|
|
@ -135,6 +129,12 @@ RGBMatrix::Options::Options()
|
|||
scan_mode(0),
|
||||
#endif
|
||||
|
||||
#ifdef DISABLE_HARDWARE_PULSES
|
||||
disable_hardware_pulsing(true),
|
||||
#else
|
||||
disable_hardware_pulsing(false),
|
||||
#endif
|
||||
|
||||
#ifdef SHOW_REFRESH_RATE
|
||||
show_refresh_rate(true),
|
||||
#else
|
||||
|
|
@ -197,7 +197,7 @@ void RGBMatrix::SetGPIO(GPIO *io, bool start_thread) {
|
|||
if (io != NULL && io_ == NULL) {
|
||||
io_ = io;
|
||||
internal::Framebuffer::InitGPIO(io_, params_.rows, params_.parallel,
|
||||
params_.allow_hardware_pulsing,
|
||||
!params_.disable_hardware_pulsing,
|
||||
params_.pwm_lsb_nanoseconds);
|
||||
}
|
||||
if (start_thread) {
|
||||
|
|
|
|||
|
|
@ -131,8 +131,11 @@ static bool FlagInit(int &argc, char **&argv,
|
|||
continue;
|
||||
if (ConsumeBoolFlag("swap-green-blue", it, &mopts->swap_green_blue))
|
||||
continue;
|
||||
if (ConsumeBoolFlag("hardware-pulse", it, &mopts->allow_hardware_pulsing))
|
||||
bool allow_hardware_pulsing = !mopts->disable_hardware_pulsing;
|
||||
if (ConsumeBoolFlag("hardware-pulse", it, &allow_hardware_pulsing)) {
|
||||
mopts->disable_hardware_pulsing = !allow_hardware_pulsing;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Runtime options.
|
||||
if (ConsumeIntFlag("slowdown-gpio", it, end, &ropts->gpio_slowdown, &err))
|
||||
|
|
@ -296,8 +299,8 @@ void PrintMatrixFlags(FILE *out, const RGBMatrix::Options &d,
|
|||
d.inverse_colors ? "no-" : "", d.inverse_colors ? "off" : "on",
|
||||
d.swap_green_blue ? "no-" : "", d.swap_green_blue ? "off" : "on",
|
||||
d.pwm_lsb_nanoseconds,
|
||||
d.allow_hardware_pulsing ? "no-" : "",
|
||||
d.allow_hardware_pulsing ? "Don't u" : "U");
|
||||
!d.disable_hardware_pulsing ? "no-" : "",
|
||||
!d.disable_hardware_pulsing ? "Don't u" : "U");
|
||||
|
||||
fprintf(out, "\t--led-slowdown-gpio=<0..2>: "
|
||||
"Slowdown GPIO. Needed for faster Pis and/or slower panels "
|
||||
|
|
|
|||
Loading…
Reference in a new issue