main.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (C) 2013 Michael McMaster <michael@codesrc.com>
  2. //
  3. // This file is part of SCSI2SD.
  4. //
  5. // SCSI2SD is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // SCSI2SD is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with SCSI2SD. If not, see <http://www.gnu.org/licenses/>.
  17. #include "device.h"
  18. // #include "blinky.h"
  19. #include "loopback.h"
  20. #include "scsi.h"
  21. #include "scsiPhy.h"
  22. #include "config.h"
  23. #include "disk.h"
  24. #include "led.h"
  25. const char* Notice = "Copyright (C) 2013 Michael McMaster <michael@codesrc.com>";
  26. int main()
  27. {
  28. // scsi2sd_test_blinky(); // Initial test. Will not return.
  29. ledOff();
  30. // Enable global interrupts.
  31. // Needed for RST and ATN interrupt handlers.
  32. CyGlobalIntEnable;
  33. // Set interrupt handlers.
  34. scsiPhyInit();
  35. // Loopback test requires the interrupt handers.
  36. // Will not return if uncommented.
  37. // scsi2sd_test_loopback();
  38. configInit();
  39. scsiInit(0, 1); // ID 0 is mac boot disk
  40. scsiDiskInit();
  41. // Reading jumpers
  42. // Is SD card detect asserted ?
  43. // TODO POST ?
  44. while (1)
  45. {
  46. scsiPoll();
  47. scsiDiskPoll();
  48. }
  49. return 0;
  50. }