Changeset e69146a in avrstuff
- Timestamp:
- Jan 15, 2012, 9:05:03 AM (12 years ago)
- Branches:
- main
- Children:
- 3c17057
- Parents:
- e07597b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
V-USB_Dev/firmwares/CrO2/main.c
re07597b re69146a 32 32 33 33 bit = 1; 34 bitpos = 0;34 bitpos = 7; 35 35 readPos = 0; 36 36 … … 73 73 // CTC mode with OCR1A as MAXregister 74 74 TCCR1B = (1<<WGM12); 75 OCR1A = 1 2800; // 800us bit clock76 OCR1B = 6 400; // Half-clock for 1 bits75 OCR1A = 13063; // 800us bit clock 76 OCR1B = 6532; // Half-clock for 1 bits 77 77 TIMSK = (1 << OCIE1B) | (1 << OCIE1A); // interrupts on both timer matches. 78 78 TCCR1A |= (bit << FOC1A); // Force toggle of A (make sure output is a logic 1 to allow MO5 to detect tapedrive) … … 134 134 TCCR1A &= ~(1<<COM1A1); 135 135 TCCR1B |= (1<<CS10); 136 blksz = 35; 136 137 return 1; 137 138 } else { … … 147 148 // generate next bit 148 149 bit = (ioblock[readPos] >> bitpos) & 1; 149 bitpos ++;150 if (bitpos > 7) 150 bitpos--; 151 if (bitpos > 7) // overflow ? 151 152 { 152 bitpos = 0;153 bitpos = 7; 153 154 readPos++; 154 155 if (readPos > blksz)
Note:
See TracChangeset
for help on using the changeset viewer.