   negative = 0;
 }
 
-void handleRfRemoteButtons()
-{
-  static int old_button_states = Pressed::all;
-  int button_states = PINC & B1111;
-
-  if (button_states == old_button_states) {
-    return;
-  }
-  old_button_states = button_states;
-
+void performPendingOperations(PendingOperations & ops)
+{
 #ifdef DEBUG
-  Serial.print(F("\nPressed buttons: "));
-  switch (button_states) {
-    case Pressed::none: Serial.print(F("NONE")); break;
-    case Pressed::d:    Serial.print(F("   D")); break;
-    case Pressed::c:    Serial.print(F("  C ")); break;
-    case Pressed::cd:   Serial.print(F("  CD")); break;
-    case Pressed::b:    Serial.print(F(" B  ")); break;
-    case Pressed::bd:   Serial.print(F(" B D")); break;
-    case Pressed::bc:   Serial.print(F(" BC ")); break;
-    case Pressed::bcd:  Serial.print(F(" BCD")); break;
-    case Pressed::a:    Serial.print(F("A   ")); break;
-    case Pressed::ad:   Serial.print(F("A  D")); break;
-    case Pressed::ac:   Serial.print(F("A C ")); break;
-    case Pressed::acd:  Serial.print(F("A CD")); break;
-    case Pressed::ab:   Serial.print(F("AB  ")); break;
-    case Pressed::abd:  Serial.print(F("AB D")); break;
-    case Pressed::abc:  Serial.print(F("ABC ")); break;
-    case Pressed::abcd: Serial.print(F("ABCD")); break;
-  }
+  printPendingOperations(ops);
 #endif
+
+  if (ops.cycle_brightness)    brightness -= BRIGHTNESS_STEP;
+  if (ops.skip_video)          infile.close();
+  if (ops.cycle_ceiling_red)   r_intensity.lowerCeil();
+  if (ops.cycle_ceiling_green) g_intensity.lowerCeil();
+  if (ops.cycle_ceiling_blue)  b_intensity.lowerCeil();
+  if (ops.cycle_floor_red)     r_intensity.raiseFloor();
+  if (ops.cycle_floor_green)   g_intensity.raiseFloor();
+  if (ops.cycle_floor_blue)    b_intensity.raiseFloor();
+  if (ops.toggle_negative)     negative = !negative;
+  if (ops.reset_settings)      resetDefaultSettings();
+
+#ifdef DEBUG
+  if (    ops.cycle_brightness
+       || ops.skip_video
+       || ops.cycle_ceiling_red
+       || ops.cycle_ceiling_green
+       || ops.cycle_ceiling_blue
+       || ops.cycle_floor_red
+       || ops.cycle_floor_green
+       || ops.cycle_floor_blue
+       || ops.toggle_negative
+       || ops.reset_settings)
+  {
+    printSettings();
+  }
+#endif
+}
+
+ISR(PCINT1_vect) // handle pin change interrupt for A0 to A5
+{
+  // Atomically read pins A0-A5, mask off A4 and A5, and represent
+  // the states of A0, A1, A2, and A3 as a Pressed enum object
+  auto button_states = static_cast<Pressed>(PINC & B1111);
 
   switch(Mode) {
     case NORMAL_MODE: {
       switch (button_states) {
-        case Pressed::d:
-        default: return;
-
         case Pressed::a: {
-          brightness -= BRIGHTNESS_STEP; // overflow to 255 at zero
+          GlobalPendingOperations.cycle_brightness = 1;
         } break;
 
         case Pressed::b: {
-          nextFile();
+          GlobalPendingOperations.skip_video = 1;
         } break;
 
         case Pressed::ab: {

  MACRO_MODE,
  MISC_MODE,
} Mode;

apa106<D, 6>   LEDstrip;
rgb frame[200];


void loop()
{
  if (!readFrame()) {
    nextFile();
    startMillis = millis();
    return;
  }

  PendingOperations pending_operations;
  noInterrupts();
  memcpy(&pending_operations, &GlobalPendingOperations, sizeof(pending_operations));
  memset(&GlobalPendingOperations, 0, sizeof(GlobalPendingOperations));
  interrupts();

  performPendingOperations(pending_operations);

  adjustFrameColors();

  while (millis() - startMillis < 50UL) {
    // busy loop until its time to paint the lights
