Changeset e69146a in avrstuff


Ignore:
Timestamp:
Jan 15, 2012, 9:05:03 AM (12 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
3c17057
Parents:
e07597b
Message:
  • Generate MSb first.
  • WORKING FILE HEADER SENT !

git-svn-id: svn://pulkomandy.tk/avrstuff@53 c6672c3c-f6b6-47f9-9001-1fd6b12fecbe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • V-USB_Dev/firmwares/CrO2/main.c

    re07597b re69146a  
    3232
    3333        bit = 1;
    34         bitpos = 0;
     34        bitpos = 7;
    3535        readPos = 0;
    3636
     
    7373        // CTC mode with OCR1A as MAXregister
    7474        TCCR1B = (1<<WGM12);
    75         OCR1A = 12800; // 800us bit clock
    76         OCR1B = 6400; // Half-clock for 1 bits
     75        OCR1A = 13063; // 800us bit clock
     76        OCR1B = 6532; // Half-clock for 1 bits
    7777        TIMSK = (1 << OCIE1B) | (1 << OCIE1A); // interrupts on both timer matches.
    7878        TCCR1A |= (bit << FOC1A); // Force toggle of A (make sure output is a logic 1 to allow MO5 to detect tapedrive)
     
    134134                TCCR1A &= ~(1<<COM1A1);
    135135                TCCR1B |= (1<<CS10);
     136                blksz = 35;
    136137                return 1;
    137138        } else {
     
    147148        // generate next bit
    148149        bit = (ioblock[readPos] >> bitpos) & 1;
    149         bitpos++;
    150         if (bitpos > 7)
     150        bitpos--;
     151        if (bitpos > 7) // overflow ?
    151152        {
    152                 bitpos = 0;
     153                bitpos = 7;
    153154                readPos++;
    154155                if (readPos > blksz)
Note: See TracChangeset for help on using the changeset viewer.