Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
508 kaklik 1
/* 
2
 * Copyright (C) 2004 Darren Hutchinson (dbh@gbdt.com.au)
3
 * 
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU Library General Public License as published by
6
 * the Free Software Foundation; either version 2 of the License, or (at your
7
 * option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful, but
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
12
 * License for more details.
13
 * 
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this software; see the file COPYING.  If not, write to
16
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
17
 * MA 02111-1307, USA. 
18
 *
19
 * $Id: eq6.c,v 1.4 2004/04/04 10:32:50 dbh Exp $
20
 */
21
 
22
#include <avr/interrupt.h>
23
 
24
#include "eq6.h"
25
#include "paddle.h"
26
#include "stepper.h"
27
#include "driver.h"
28
#include "serial.h"
29
#include "pguide.h"
30
#include "sr.h"
31
 
32
volatile uint32_t    idleCtr;
33
 
34
/* main() is called after the basic system initialization. This 
35
 * initialises the program modules (these are, generally, interrupt
36
 * driver), and then waits for the end of civilization as we know it
37
 *
38
 * Passed:
39
 *     Nothing
40
 *
41
 * Returns:
42
 *     Nothing
43
 *
44
 * Notes:
45
 *     There is little to do here but wait.
46
 */
47
int
48
main(void)
49
{
50
    DDRA = 0xff;
51
    DDRC = 0xff;
52
    PORTA = 0x0;
53
    PORTC = 0x0;
54
 
55
    /* Initialize the modules */
56
    paddleInit();
57
    stepperInit();
58
    driverInit();
59
    serialInit();
60
    pguideInit();
61
 
62
    /* Load save data (if any) from the EEPROM */
63
    srLoadState();
64
 
65
    setupRateTable(transRatio);
66
    setTrackRate(0);
67
    setTrackRate(trackingRate);
68
 
69
    /* Enable interrupts */
70
    sei();
71
 
72
    /* Increment the idle counter to get some idea of the system
73
     * idle time
74
     */
75
    for (;;)
76
    {
77
        if (doSave)
78
        {
79
            doSave = 0;
80
            srSaveState();
81
        }
82
    }
83
 
84
    /* NOTREACHED */
85
    return 0;
86
}