Skip to content

Commit

Permalink
Simpliy Init()-ialization: don't offer enable64, just auto-determine.
Browse files Browse the repository at this point in the history
Use of 64 bits can be determined when bits are requested.
  • Loading branch information
hzeller committed Aug 15, 2020
1 parent 140a683 commit f89bd15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class GPIO {
#if RGB_SLOWDOWN_GPIO
slowdown = RGB_SLOWDOWN_GPIO,
#else
slowdown = 1,
slowdown = 1
#endif
bool enable_64 = false
);


// Initialize outputs.
// Returns the bits that were available and could be set for output.
// (never use the optional adafruit_hack_needed parameter, it is used
Expand Down
2 changes: 1 addition & 1 deletion include/led-matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class RGBMatrix : public Canvas {
// convenient as it allows to wait for a change.
//
// Returns the bitmap of all GPIO input pins.
uint64_t AwaitInputChange(int timeout_ms);
gpio_bits_t AwaitInputChange(int timeout_ms);

//-- Double- and Multibuffering.

Expand Down
5 changes: 2 additions & 3 deletions lib/gpio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace rgb_matrix {
);

GPIO::GPIO() : output_bits_(0), input_bits_(0), reserved_bits_(0),
slowdown_(1) {
slowdown_(1), enable_64_(false) {
}

gpio_bits_t GPIO::InitOutputs(gpio_bits_t outputs,
Expand Down Expand Up @@ -343,9 +343,8 @@ static bool mmap_all_bcm_registers_once() {
return true;
}

bool GPIO::Init(int slowdown, bool enable_64) {
bool GPIO::Init(int slowdown) {
slowdown_ = slowdown;
enable_64_ = enable_64;

// Pre-mmap all bcm registers we need now and possibly in the future, as to
// allow dropping privileges after GPIO::Init() even as some of these
Expand Down

0 comments on commit f89bd15

Please sign in to comment.