Changeset 64

Show
Ignore:
Timestamp:
02/20/11 14:41:41 (15 months ago)
Author:
sven
Message:

Various code modifications at experimental setup with the printer.

Location:
bull-anelex-project/trunk/anelex-interface/src
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • bull-anelex-project/trunk/anelex-interface/src/anelex.c

    r63 r64  
    2828#include "anelex_code.h" 
    2929#include "anelex.h" 
     30#include "constants.h" 
    3031 
    3132void print_line() { 
    3233        // startup line printing 
    33         //puts("Starting line transmission"); 
     34        puts("Starting line transmission, waiting for CA"); 
    3435        current_line_cnt = 0; 
    3536        print_line_feed(); 
     
    4041void print_line_feed() { 
    4142        // Lege Zeilenvorschub an (spaeter mal variabel) 
     43 
     44        // Experiment: RESET vor jedem Zeilenvorschub 
     45        // 18.02.11 
     46        /* 
     47        start_reset(); 
     48        _delay_us(10); 
     49        stop_reset(); 
     50        _delay_us(10); 
     51        */  
     52 
    4253        set_data(0x01); 
    43         _delay_us(800); 
     54        _delay_us(ANELEX_NEWLINE_WAIT); 
    4455        start_strobe(); 
    45         _delay_us(1); 
     56        _delay_us(ANELEX_NEWLINE_LENGTH); 
    4657        stop_strobe(); 
    4758} 
     
    6273                        // normales zeichen 
    6374                        char transformed = anelex_code[ orig ]; 
    64                         //printf("%d: Zeichen %c, entspricht oktal %o\n", current_counter, orig, transformed); 
     75                        printf("%d: Zeichen %c, entspricht oktal %o\n", current_counter, orig, transformed); 
    6576                        //printf("%d", current_counter, orig); 
     77                        putchar(orig); 
    6678                        //_delay_us(100); 
    6779                         
    6880                        // LEGE ZEICHEN AN: 
     81                        _delay_us(ANELEX_CHAR_WAIT); 
    6982                        set_data(transformed); 
    70                         _delay_us(20);  
     83                        _delay_us(ANELEX_CHAR_STROBE_WAIT); 
    7184                        start_strobe(); 
    72                         _delay_us(2); 
     85                        _delay_us(ANELEX_CHAR_STROBE_LENGTH); 
    7386                        stop_strobe(); 
    7487                        // jetzt bis zum naechsten Zeichen warten 
     
    8396        line_state = LINE_PRINTING; 
    8497        set_data(0x01); // aufraeumen am DATENPORT 
    85         //printf("Print Command\n"); 
     98        printf("Print Command\n"); 
    8699 
    87100        start_printcmd(); 
    88         _delay_us(10); 
     101        _delay_us(ANELEX_PRINT_CMD_LENGTH); 
    89102        stop_printcmd(); 
    90103        // warten auf auf das naechste CA. 
     
    96109                return; 
    97110 
    98         //printf("Zeile wird gedruckt...\n"); 
     111        printf("Zeile wird gedruckt...\n"); 
    99112        //puts("printing"); 
    100113        while(!is_ready()); // das ist jetzt ziemlicher ... quatsch 
    101114        puts("line finished"); 
    102         //printf("Zeile fertig gedruckt\n"); 
     115        printf("Zeile fertig gedruckt\n"); 
    103116 
    104117        line_state = LINE_FINISHED; 
  • bull-anelex-project/trunk/anelex-interface/src/data.c

    r63 r64  
    6262 
    6363char string_numbers[] PROGMEM = "\ 
    64 1234567890123456789012345678901234567890123456789012345678901234567890\n\ 
     64123\n\ 
     651234567890\n\ 
     6612345678901234567890\n\ 
     67123456789012345678901234567890\n\ 
     681234567890123456789012345678901234567890\n\ 
     6912345678901234567890123456789012345678901234567890\n\ 
    6570123456789012345678901234567890123456789012345678901234567890\n\ 
    66 12345678901234567890123456789012345678901234567890\n\ 
    67 1234567890123456789012345678901234567890\n\ 
    68 123456789012345678901234567890\n\ 
    69 12345678901234567890\n\ 
    70 1234567890\n\ 
    71 123\n"; 
     711234567890123456789012345678901234567890123456789012345678901234567890\n"; 
    7272 
    7373// yes, this IS the help message which is printed via RS232 on "?help" command. 
  • bull-anelex-project/trunk/anelex-interface/src/frontend.c

    r63 r64  
    131131        memset(&current_line, 0, LINE_LENGTH); // null the output buffer (important) 
    132132 
    133         printf("Readline!\n"); 
     133        //printf("Readline!\n"); 
    134134        // check if we get the text from ROM 
    135135        if(builtin_data.index) { 
     
    155155                        while(is_button()); 
    156156                        puts("Button pressed."); 
    157                         strcpy(current_line, "?print 1"); 
     157                        strcpy(current_line, "?print 5"); 
    158158                        return; // important: Quit readline now. 
    159159                } else if(!is_cts()) { 
  • bull-anelex-project/trunk/anelex-interface/src/frontend.h

    r63 r64  
    7979 **/ 
    8080 
    81 #define BUFFER_LEN 20 
     81#define BUFFER_LEN 100 
    8282 
    8383volatile struct print_buffer_t { 
  • bull-anelex-project/trunk/anelex-interface/src/main.c

    r63 r64  
    1111#include "toolchain.h" 
    1212#include "frontend.h" 
     13#include "constants.h" 
     14 
    1315 
    1416static FILE output = FDEV_SETUP_STREAM(stdout_transmit, NULL, _FDEV_SETUP_WRITE); 
     
    8991                while(line_state != LINE_FINISHED) { 
    9092                        puts("Wait for printer finished..."); 
    91                         _delay_ms(200); 
     93                        _delay_ms(ANELEX_WAIT_PRINTER_FINISHED); 
    9294                } 
    9395 
  • bull-anelex-project/trunk/anelex-interface/src/wiring.h

    r62 r64  
    7373#define start_printcmd() ( PORTC &= ~(1 << PORTC_PRINTCMD) ) 
    7474#define stop_printcmd()  ( PORTC |= (1 << PORTC_PRINTCMD) ) 
     75#define start_reset()    ( PORTC &= ~(1 << PORTC_RESET) ) 
     76#define stop_reset()     ( PORTC |= (1 << PORTC_RESET) ) 
    7577 
    7678// Port Output D: Apperatus Indicators, flow control 
© 2008 - 2010 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