Changeset 71 in projects


Ignore:
Timestamp:
Mar 30, 2013, 3:01:08 PM (6 years ago)
Author:
sven
Message:

Bugfix for faulty NL to CRNL conversion at binary jones output

Location:
punch-card-project/trunk/driver/documation-m200/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • punch-card-project/trunk/driver/documation-m200/src/protocol.c

    r56 r71  
    4949
    5050// Haupt-Transmit-Routine, backend von stdio
     51// Used for ordinary string output
     52// Usage: fputc, fputs, putchar
    5153int uart_transmit_main(char c, FILE* stream) {
    5254        if(c == '\n')
    5355                uart_transmit_main('\r', stream);
    5456
     57        uart_transmit_binary(c);
     58        return 0;
     59}
     60
     61// Haupt-Transmit-Routine, binary backend von stdio-like
     62// Usage: fputc(c, binary_main_thread);
     63void uart_transmit_binary(char c) {
     64        // only difference to uart_transmit_main: No "\n" => "\r\n" conversion since
     65        // data is treated as binary
     66       
    5567        while (!(UCSR0A & 0b00100000));
    5668        // PENDING: Hardware flow control
    5769        UDR0 = c;
    58         return 0;
    5970}
    6071
     
    148159                                        odd_col = current_read_card.columns[x++];
    149160
    150                                         putchar( even_col >> 4 ); // erstes byte
    151                                         putchar( ((even_col & 017) << 4) | (odd_col >> 8) ); // zweites byte
    152                                         putchar( odd_col & 00377 ); // drittes byte
     161                                        // bypass stdout for avoiding EOL conversion
     162                                        uart_transmit_binary( even_col >> 4 ); // erstes byte
     163                                        uart_transmit_binary( ((even_col & 017) << 4) | (odd_col >> 8) ); // zweites byte
     164                                        uart_transmit_binary( odd_col & 00377 ); // drittes byte
    153165                                }
    154166                        }
  • punch-card-project/trunk/driver/documation-m200/src/protocol.h

    r56 r71  
    4545int uart_transmit(char c, FILE* stream);
    4646int uart_transmit_main(char c, FILE* stream);
     47void uart_transmit_binary(char c);
    4748
    4849// A char value as return value from uart_recieve
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License