led.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* sd2iec - SD/MMC to Commodore serial bus interface/controller
  2. Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
  3. Inspiration and low-level SD/MMC access based on code from MMC2IEC
  4. by Lars Pontoppidan et al., see sdcard.c|h and config.h.
  5. FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; version 2 of the License only.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. led.c: Overdesigned LED handling
  17. */
  18. #include <avr/io.h>
  19. #include "config.h"
  20. #include "led.h"
  21. volatile uint8_t led_state;
  22. /**
  23. * update_leds - set LEDs to correspond to the buffer status
  24. *
  25. * This function sets the busy/dirty LEDs to correspond to the current state
  26. * of the buffers, i.e. busy on of at least one non-system buffer is
  27. * allocated and dirty on if at least one buffer is allocated for writing.
  28. * Call if you have manually changed the LEDs and you want to restore the
  29. * "default" state.
  30. */
  31. void update_leds(void) {
  32. }
  33. void toggle_busy_led(void) {
  34. PORTB &= ~_BV(PB1);
  35. DDRB ^= _BV(PB1);
  36. }