@@ -0,0 +1,44 | |||||
|
1 | #------------------------------------------------------------------------------ | |||
|
2 | #-- This file is a part of the LPP VHDL IP LIBRARY | |||
|
3 | #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS | |||
|
4 | #-- | |||
|
5 | #-- This program 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 | #-- This program 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 this program; if not, write to the Free Software | |||
|
17 | #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
|
18 | #------------------------------------------------------------------------------ | |||
|
19 | ||||
|
20 | include ../../rules.mk | |||
|
21 | LIBDIR = ../../lib | |||
|
22 | INCPATH = ../../includes | |||
|
23 | SCRIPTDIR=../../scripts/ | |||
|
24 | LIBS=-llpp_apb_functions | |||
|
25 | INPUTFILE=main.c | |||
|
26 | EXEC=exec.bin | |||
|
27 | OUTBINDIR=bin/debug/ | |||
|
28 | ||||
|
29 | ||||
|
30 | .PHONY:bin | |||
|
31 | ||||
|
32 | all:bin | |||
|
33 | @echo $(EXEC)" file created" | |||
|
34 | ||||
|
35 | clean: | |||
|
36 | rm -f *.{o,a} | |||
|
37 | ||||
|
38 | ||||
|
39 | ||||
|
40 | help:ruleshelp | |||
|
41 | @echo " all : makes an executable file called "$(EXEC) | |||
|
42 | @echo " in "$(OUTBINDIR) | |||
|
43 | @echo " clean : removes temporary files" | |||
|
44 |
@@ -0,0 +1,33 | |||||
|
1 | #include "stdio.h" | |||
|
2 | #include "lpp_apb_functions.h" | |||
|
3 | ||||
|
4 | ||||
|
5 | ||||
|
6 | int main() | |||
|
7 | { | |||
|
8 | int d=0; | |||
|
9 | while(d!=10) | |||
|
10 | { | |||
|
11 | scanf("%d",&d); | |||
|
12 | switch(d) | |||
|
13 | { | |||
|
14 | case 0: | |||
|
15 | printf("cursor OFF \n"); | |||
|
16 | break; | |||
|
17 | case 1: | |||
|
18 | printf("cursor ON \n"); | |||
|
19 | break; | |||
|
20 | case 2: | |||
|
21 | break; | |||
|
22 | case 3: | |||
|
23 | apbprintdeviceslist(); | |||
|
24 | break; | |||
|
25 | case 10: | |||
|
26 | return 0; | |||
|
27 | break; | |||
|
28 | default: | |||
|
29 | break; | |||
|
30 | } | |||
|
31 | } | |||
|
32 | return 0; | |||
|
33 | } |
@@ -0,0 +1,1 | |||||
|
1 | load bin/exec.bin |
@@ -1,42 +1,44 | |||||
1 | #------------------------------------------------------------------------------ |
|
1 | #------------------------------------------------------------------------------ | |
2 | #-- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | #-- This file is a part of the LPP VHDL IP LIBRARY | |
3 | #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS | |
4 | #-- |
|
4 | #-- | |
5 | #-- This program is free software; you can redistribute it and/or modify |
|
5 | #-- This program is free software; you can redistribute it and/or modify | |
6 | #-- it under the terms of the GNU General Public License as published by |
|
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 |
|
7 | #-- the Free Software Foundation; either version 3 of the License, or | |
8 | #-- (at your option) any later version. |
|
8 | #-- (at your option) any later version. | |
9 | #-- |
|
9 | #-- | |
10 | #-- This program is distributed in the hope that it will be useful, |
|
10 | #-- This program is distributed in the hope that it will be useful, | |
11 | #-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | #-- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | #-- GNU General Public License for more details. |
|
13 | #-- GNU General Public License for more details. | |
14 | #-- |
|
14 | #-- | |
15 | #-- You should have received a copy of the GNU General Public License |
|
15 | #-- You should have received a copy of the GNU General Public License | |
16 | #-- along with this program; if not, write to the Free Software |
|
16 | #-- along with this program; if not, write to the Free Software | |
17 |
#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | #------------------------------------------------------------------------------ |
|
18 | #------------------------------------------------------------------------------ | |
19 |
|
19 | |||
20 | include ../../../rules.mk |
|
20 | include ../../../rules.mk | |
21 |
LIBDIR = ../../../lib |
|
21 | LIBDIR = ../../../lib | |
22 |
INCPATH = ../../../includes |
|
22 | INCPATH = ../../../includes | |
23 | SCRIPTDIR=../../../scripts/ |
|
23 | SCRIPTDIR=../../../scripts/ | |
24 | LIBS=-lapb_lcd_driver -llpp_apb_functions |
|
24 | LIBS=-lapb_lcd_driver -llpp_apb_functions | |
25 | INPUTFILE=main.c |
|
25 | INPUTFILE=main.c | |
26 | EXEC=main.bin |
|
26 | EXEC=main.bin | |
27 | OUTBINDIR=bin/ |
|
27 | OUTBINDIR=bin/ | |
28 |
|
28 | |||
29 |
|
29 | |||
|
30 | .PHONY:bin | |||
|
31 | ||||
30 | all:bin |
|
32 | all:bin | |
31 | @echo $(EXEC)" file created" |
|
33 | @echo $(EXEC)" file created" | |
32 |
|
34 | |||
33 | clean: |
|
35 | clean: | |
34 | rm -f *.{o,a} |
|
36 | rm -f *.{o,a} | |
35 |
|
37 | |||
36 |
|
38 | |||
37 |
|
39 | |||
38 | help:ruleshelp |
|
40 | help:ruleshelp | |
39 | @echo " all : makes an executable file called "$(EXEC) |
|
41 | @echo " all : makes an executable file called "$(EXEC) | |
40 | @echo " in "$(OUTBINDIR) |
|
42 | @echo " in "$(OUTBINDIR) | |
41 | @echo " clean : removes temporary files" |
|
43 | @echo " clean : removes temporary files" | |
42 |
|
44 |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,63 +1,63 | |||||
1 | #------------------------------------------------------------------------------ |
|
1 | #------------------------------------------------------------------------------ | |
2 | #-- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | #-- This file is a part of the LPP VHDL IP LIBRARY | |
3 | #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS | |
4 | #-- |
|
4 | #-- | |
5 | #-- This program is free software; you can redistribute it and/or modify |
|
5 | #-- This program is free software; you can redistribute it and/or modify | |
6 | #-- it under the terms of the GNU General Public License as published by |
|
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 |
|
7 | #-- the Free Software Foundation; either version 3 of the License, or | |
8 | #-- (at your option) any later version. |
|
8 | #-- (at your option) any later version. | |
9 | #-- |
|
9 | #-- | |
10 | #-- This program is distributed in the hope that it will be useful, |
|
10 | #-- This program is distributed in the hope that it will be useful, | |
11 | #-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | #-- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | #-- GNU General Public License for more details. |
|
13 | #-- GNU General Public License for more details. | |
14 | #-- |
|
14 | #-- | |
15 | #-- You should have received a copy of the GNU General Public License |
|
15 | #-- You should have received a copy of the GNU General Public License | |
16 | #-- along with this program; if not, write to the Free Software |
|
16 | #-- along with this program; if not, write to the Free Software | |
17 | #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | #------------------------------------------------------------------------------ |
|
18 | #------------------------------------------------------------------------------ | |
19 |
|
19 | |||
20 | CC = sparc-elf-gcc |
|
20 | CC = sparc-elf-gcc | |
21 | AR = sparc-elf-ar |
|
21 | AR = sparc-elf-ar | |
22 | LIBDIR = ../../lib/ |
|
22 | LIBDIR = ../../lib/ | |
23 |
INCPATH = ../../includes |
|
23 | INCPATH = ../../includes | |
24 | SCRIPTDIR=../../scripts/ |
|
24 | SCRIPTDIR=../../scripts/ | |
25 | OUTBINDIR=bin/ |
|
25 | OUTBINDIR=bin/ | |
26 | EXEC=exec.bin |
|
26 | EXEC=exec.bin | |
27 | INPUTFILE=main.c |
|
27 | INPUTFILE=main.c | |
28 |
|
28 | |||
29 | $(FILE): $(FILE).a |
|
29 | $(FILE): $(FILE).a | |
30 | @echo "library ""lib"$(FILE)" created" |
|
30 | @echo "library ""lib"$(FILE)" created" | |
31 |
|
31 | |||
32 |
|
32 | |||
33 | $(FILE).o: |
|
33 | $(FILE).o: | |
34 | mkdir tmp |
|
34 | mkdir -p tmp | |
35 | $(CC) -c $(FILE).c -I $(INCPATH) -o tmp/$(FILE).o |
|
35 | $(CC) -c $(FILE).c -I $(INCPATH) -o tmp/$(FILE).o | |
36 |
|
36 | |||
37 | $(FILE).a: $(FILE).o |
|
37 | $(FILE).a: $(FILE).o | |
38 | $(AR) rs $(LIBDIR)"lib"$(FILE).a tmp/$(FILE).o |
|
38 | $(AR) rs $(LIBDIR)"lib"$(FILE).a tmp/$(FILE).o | |
39 | cp *.h $(INCPATH) |
|
39 | cp *.h $(INCPATH) | |
40 | rm -R tmp |
|
40 | rm -R tmp | |
41 |
|
41 | |||
42 | load: all |
|
42 | load: all | |
43 | @echo "load "$(OUTBINDIR)$(EXEC)>$(SCRIPTDIR)load.txt |
|
43 | @echo "load "$(OUTBINDIR)$(EXEC)>$(SCRIPTDIR)load.txt | |
44 | grmon-eval -uart $(PORT) -u -c $(SCRIPTDIR)load.txt |
|
44 | grmon-eval -uart $(PORT) -u -c $(SCRIPTDIR)load.txt | |
45 |
|
45 | |||
46 | bin: |
|
46 | bin: | |
47 | mkdir -p $(OUTBINDIR) |
|
47 | mkdir -p $(OUTBINDIR) | |
48 | $(CC) $(INPUTFILE) -o $(OUTBINDIR)/$(EXEC) -I $(INCPATH) -L $(LIBDIR) -static $(LIBS) |
|
48 | $(CC) $(INPUTFILE) -o $(OUTBINDIR)/$(EXEC) -I $(INCPATH) -L $(LIBDIR) -static $(LIBS) | |
49 |
|
49 | |||
50 | clean: |
|
50 | clean: | |
51 | rm -f -R tmp |
|
51 | rm -f -R tmp | |
52 | rm -f *.{o,a} |
|
52 | rm -f *.{o,a} | |
53 | rm -f $(INCPATH)*.h |
|
53 | rm -f $(INCPATH)*.h | |
54 | rm -f $(LIBDIR)*.{o,a} |
|
54 | rm -f $(LIBDIR)*.{o,a} | |
55 |
|
55 | |||
56 | ruleshelp: |
|
56 | ruleshelp: | |
57 | @echo "" |
|
57 | @echo "" | |
58 | @echo "" |
|
58 | @echo "" | |
59 | @echo "" |
|
59 | @echo "" | |
60 | @echo " load : call grmon-eval and loads "$(EXEC)" in the leon" |
|
60 | @echo " load : call grmon-eval and loads "$(EXEC)" in the leon" | |
61 | @echo " usage: make PORT=/dev/ttyUSBx load" |
|
61 | @echo " usage: make PORT=/dev/ttyUSBx load" | |
62 |
|
62 | |||
63 |
|
63 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now