4ae3d9650f40d6147838f7b5d9cb5758b7931d36
[SCSI2SD.git] / software / SCSI2SD / SCSI2SD.cydsn / main.c
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
18 #include "device.h"
19 #include "blinky.h"
20 #include "scsi.h"
21 #include "scsiPhy.h"
22 #include "config.h"
23 #include "disk.h"
24 #include "led.h"
25
26 const char* Notice = "Copyright (C) 2013 Michael McMaster <michael@codesrc.com>";
27
28 int main()
29 {
30 // scsi2sd_test_blink(); // Initial test. Will not return.
31 ledOff();
32
33 // Enable global interrupts.
34 // Needed for RST and ATN interrupt handlers.
35 CyGlobalIntEnable;
36
37 // Set interrupt handlers.
38 scsiPhyInit();
39
40 configInit();
41
42 scsiInit();
43 scsiDiskInit();
44
45 // Reading jumpers
46 // Is SD card detect asserted ?
47
48 // TODO POST ?
49
50 while (1)
51 {
52 scsiPoll();
53 scsiDiskPoll();
54 configPoll();
55 }
56 return 0;
57 }
58