Ejemplo n.º 1
0
/**
 * mark_buffer_clean - mark a buffer as clean
 * @buf: pointer to the buffer
 *
 * This function marks the given buffer as clean, tracks
 * this in active_buffers and turns off the dirty LED if required.
 */
void mark_buffer_clean(buffer_t *buf) {
  if (buf->dirty) {
    buf->dirty = 0;
    active_buffers -= 16;
    if (get_dirty_buffer_count() == 0)
      set_dirty_led(0);
  }
}
Ejemplo n.º 2
0
Archivo: led.c Proyecto: ivanovp/sd2iec
/**
 * update_leds - set LEDs to correspond to the buffer status
 *
 * This function sets the busy/dirty LEDs to correspond to the current state
 * of the buffers, i.e. busy on of at least one non-system buffer is
 * allocated and dirty on if at least one buffer is dirty.
 * Call if you have manually changed the LEDs and you want to restore the
 * "default" state.
 */
void update_leds(void) {
  set_busy_led(active_buffers != 0);
  set_dirty_led(get_dirty_buffer_count() != 0);
}