projects
/
my-code
/
fpga.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
somehow dirty still accurate fix
[my-code/fpga.git]
/
fx2
/
fx2.c
diff --git
a/fx2/fx2.c
b/fx2/fx2.c
index
3a57b12
..
49f0da5
100644
(file)
--- a/
fx2/fx2.c
+++ b/
fx2/fx2.c
@@
-11,10
+11,7
@@
*/
/* constant definitions */
*/
/* constant definitions */
-#define TRUE 1
-#define FALSE 0
-#define POWER_ON 1;
-#define POWER_OFF 0;
+#define GET_TDO 0x20
/* type definitions */
typedef unsigned char u8;
/* type definitions */
typedef unsigned char u8;
@@
-227,6
+224,9
@@
void ep1_init() {
void fx2_init() {
void fx2_init() {
+ /* syncdelay */
+ SYNCDELAY;
+
/* cpu init */
cpu_init();
/* cpu init */
cpu_init();
@@
-239,26
+239,29
@@
void fx2_init() {
/* ep1 init */
ep1_init();
/* ep1 init */
ep1_init();
+
+ /* jtag init */
+ jtag_init();
}
void main() {
}
void main() {
- u8 buf;
+ u8 buf
,set
;
/* initialize the fx2 */
fx2_init();
/* jtag by polling ep1 */
/* initialize the fx2 */
fx2_init();
/* jtag by polling ep1 */
+
while(1) {
if(!(EP1OUTCS&BUSY)) {
while(1) {
if(!(EP1OUTCS&BUSY)) {
+ set=IOD;
buf=EP1OUTBUF[0];
buf=EP1OUTBUF[0];
- buf&=0x1c;
- IOD|=buf;
+ IOD=(IOD&(~0x1c))|(buf&0x1c);
EP1OUTBC=1;
}
if(!(EP1INCS&BUSY)) {
EP1OUTBC=1;
}
if(!(EP1INCS&BUSY)) {
- buf=IOD&0x01?1:0;
- EP1INBUF[0]=buf;
+ EP1INBUF[0]=IOD&0x01;
EP1INBC=1;
}
}
EP1INBC=1;
}
}