/********************* TASKS ***********************/
void task_every_row(void) 
{
  static int song_count = 0;
  static int ui_count = 0;
  can_rx_dispatch_all();  
  hb_beat();          
  mcu_led_update(); 
  msimu_update();
  error_update();
  can_tx2(); // transmit all the can ids

  if (button_pushed(4))	{
    ui_count++;
    if (ui_count == 100){
      sync_led_on = !sync_led_on;
      ui_count = 0;
    }
  }
  
	if(sync_led_on) {ui_sync_led_flash();}
  else {ui_sync_led_off();}

  //update the song if it's playing
  song_update();   
}
void QGpioInputNotification::ready_read(int) {
    QByteArray line;
    gpio_value.seek(0);
    char last_value = current_value;
    line = gpio_value.readAll();

    if (line.size() < 1) {
        abort();
    } else {
        current_value = line[0];
        emit button_pushed(QChar(current_value));
        qDebug() << "click" << current_value;
    } /* endif */
    if (current_value != last_value) {
                // qDebug() << "switch value changed, old=" << last_value << "current_value" << current_value;
    } /* endif */
}