Changeset 16cf6ff in avrstuff
- Timestamp:
- Jul 12, 2012, 10:20:53 PM (11 years ago)
- Branches:
- main
- Children:
- f2bd94f
- Parents:
- a6ae6ac
- Location:
- EPRoxygen
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
EPRoxygen/Makefile
ra6ae6ac r16cf6ff 1 eproxygen: main.o at29c040.o 1 eproxygen: main.o at29c040.o 27c020.o 2 2 g++ -Wall -g -O3 -fno-rtti -fno-exceptions $^ -o $@ 3 3 -
EPRoxygen/device.h
ra6ae6ac r16cf6ff 20 20 {}; 21 21 22 virtual ~Device() { 23 shutdown(); 24 }; 25 22 26 void shutdown(); 23 27 virtual void power() = 0; … … 38 42 return 0; 39 43 } 40 41 virtual ~Device() {};42 43 44 protected: 44 45 typedef enum { … … 131 132 usleep(1000); 132 133 byte |= inb(port + 1) >> 4; 133 printf("R %X", byte ^ 0x88);134 getchar();135 134 outb(port+2, NYBLE ^ 4); 136 135 usleep(1000); -
EPRoxygen/main.cpp
ra6ae6ac r16cf6ff 10 10 11 11 #include "device.h" 12 #include "27c020.h" 12 13 #include "at29c040.h" 13 14 … … 22 23 int error = 0; 23 24 24 puts("EPRoxygen - UNIX driver for SEEIT EPR-02 ROM programmer\n"25 fprintf(stderr, "EPRoxygen - UNIX driver for SEEIT EPR-02 ROM programmer\n" 25 26 "Copyright 2012, Adrien Destugues <pulkomandy@pulkomandy.tk>\n" 26 27 "Distributed under the terms of the MIT licence\n" … … 48 49 case 'd': 49 50 // TODO Set device 50 if (strcmp(optarg, "AT29C040") )51 if (strcmp(optarg, "AT29C040") == 0) 51 52 { 53 device = new AT29C040(); 54 } else if(strcmp(optarg, "27C020") == 0) 55 { 56 device = new x27C020(); 57 } else { 52 58 fprintf(stderr,"Unknown device (only AT29C040 is supported)\n"); 53 59 error = -3; 54 60 goto abort; 55 61 } 56 device = new AT29C040();57 62 break; 58 63 case 'r': … … 71 76 opcode = c; 72 77 } 78 } 79 80 if (optind < argc) 81 { 82 fprintf(stderr, "Error parsing the command line before \"%s\"\n", argv[optind]); 83 error = -7; 84 goto abort; 73 85 } 74 86 … … 94 106 } 95 107 96 // TODO Ask user to put ROM on socket 97 puts("Now insert chip into socket, then press any key..."); 108 fprintf(stderr,"Now insert chip into socket, then press any key...\n"); 98 109 getchar(); 99 110 … … 117 128 118 129 abort: 119 device->shutdown();130 // TODO in case ioperm failed, delete will try to shutdown() and give a bus error... 120 131 delete device; 121 132
Note:
See TracChangeset
for help on using the changeset viewer.