FreeCalypso > hg > freecalypso-sw
annotate loadtools/compalram.c @ 1033:5ab737ac3ad7
TCH special feature documentation update
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 01 Jun 2016 02:06:44 +0000 |
parents | 86ff6d0b0a97 |
children |
rev | line source |
---|---|
945
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This module contains the main() function for fc-compalram, a trivial |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * utility that feeds a binary download image to Compal's bootloader |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 * and then switches into serial tty pass-through. |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 */ |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <stdio.h> |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include <stdlib.h> |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 extern char *target_ttydev; |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 main(argc, argv) |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 char **argv; |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 { |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 if (argc != 3) { |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 fprintf(stderr, "usage: fc-compalram ttyport image.bin\n"); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 exit(1); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 } |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 target_ttydev = argv[1]; |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 set_compalstage_fullpath(argv[2]); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 open_target_serial(); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 perform_compal_stage(0); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 tty_passthru(); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 exit(0); |
86ff6d0b0a97
loadtools: fc-compalram trivial utility added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 } |