Changeset 51 in projects


Ignore:
Timestamp:
Dec 14, 2009, 9:48:24 PM (10 years ago)
Author:
sven
Message:

Sorted the sources a bit:

  • moved all the interrupt and card ring buffer related things to driver.c
  • renamed io.c (stupid name) to protocol.c (good name)
Location:
punch-card/driver/documation-m200
Files:
2 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • punch-card/driver/documation-m200/avr-m200-card-reader-controller.aps

    r50 r51  
    1 <AVRStudio><MANAGEMENT><ProjectName>avr-m200-card-reader-controller</ProjectName><Created>03-Dec-2009 19:44:28</Created><LastEdit>14-Dec-2009 19:22:54</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>03-Dec-2009 19:44:28</Created><Version>4</Version><Build>4, 17, 0, 655</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>bin\avr-m200-card-reader-controller.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>src\main.c</SOURCEFILE><SOURCEFILE>src\punchcard.c</SOURCEFILE><SOURCEFILE>src\io.c</SOURCEFILE><HEADERFILE>src\punchcard.h</HEADERFILE><HEADERFILE>src\wiring.h</HEADERFILE><HEADERFILE>D:\Server\htdocs\paper-tape-project\punch-card\protocols\documation-m200\pc-uc-protocol.h</HEADERFILE><HEADERFILE>src\io.h</HEADERFILE><OTHERFILE>bin\avr-m200-card-reader-controller.lss</OTHERFILE><OTHERFILE>bin\avr-m200-card-reader-controller.map</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>avr-m200-card-reader-controller.elf</OUTPUTFILENAME><OUTPUTDIR>bin\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS><INCLUDE>..\protocols\documation-m200\</INCLUDE><INCLUDE>..\..\protocols\documation-m200\</INCLUDE></INCDIRS><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99   -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>D:\WinAVR\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>D:\WinAVR\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\src\punchcard.h</Name><Name>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\src\wiring.h</Name><Name>D:\Server\htdocs\paper-tape-project\punch-card\protocols\documation-m200\pc-uc-protocol.h</Name><Name>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\src\io.h</Name><Name>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\src\main.c</Name><Name>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\src\punchcard.c</Name><Name>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\src\io.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="1" orderaddress="0" ordergroup="1"/></IOView><Files><File00000><FileId>00000</FileId><FileName>src\main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>src\punchcard.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>src\wiring.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>src\io.c</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>src\io.h</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>src\punchcard.c</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>D:\Server\htdocs\paper-tape-project\punch-card\protocols\documation-m200\pc-uc-protocol.h</FileName><Status>1</Status></File00006></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
     1<AVRStudio><MANAGEMENT><ProjectName>avr-m200-card-reader-controller</ProjectName><Created>03-Dec-2009 19:44:28</Created><LastEdit>14-Dec-2009 21:39:14</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>03-Dec-2009 19:44:28</Created><Version>4</Version><Build>4, 17, 0, 655</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>bin\avr-m200-card-reader-controller.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>src\main.c</SOURCEFILE><SOURCEFILE>src\punchcard.c</SOURCEFILE><SOURCEFILE>src\protocol.c</SOURCEFILE><SOURCEFILE>src\driver.c</SOURCEFILE><HEADERFILE>src\punchcard.h</HEADERFILE><HEADERFILE>src\wiring.h</HEADERFILE><HEADERFILE>D:\Server\htdocs\paper-tape-project\punch-card\protocols\documation-m200\pc-uc-protocol.h</HEADERFILE><HEADERFILE>src\protocol.h</HEADERFILE><HEADERFILE>src\driver.h</HEADERFILE><OTHERFILE>bin\avr-m200-card-reader-controller.lss</OTHERFILE><OTHERFILE>bin\avr-m200-card-reader-controller.map</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>avr-m200-card-reader-controller.elf</OUTPUTFILENAME><OUTPUTDIR>bin\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS><INCLUDE>..\protocols\documation-m200\</INCLUDE><INCLUDE>..\..\protocols\documation-m200\</INCLUDE></INCDIRS><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99   -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>D:\WinAVR\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>D:\WinAVR\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="1" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
  • punch-card/driver/documation-m200/bin/Makefile

    r50 r51  
    4141
    4242## Objects that must be built in order to link
    43 OBJECTS = main.o punchcard.o io.o
     43OBJECTS = main.o punchcard.o protocol.o driver.o
    4444
    4545## Objects explicitly added by the user
     
    5656        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
    5757
    58 io.o: ../src/io.c
     58protocol.o: ../src/protocol.c
     59        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
     60
     61driver.o: ../src/driver.c
    5962        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
    6063
  • punch-card/driver/documation-m200/src/main.c

    r50 r51  
    33 * Main file
    44 *
    5  * This file implements interrupt control, user I/O and the program flow.
    6  * The card model is implemented by punchcard.{h, c}.
     5 * This file contains the main() routine, initializes all systems (stdio,
     6 * UART, ports, etc.) and calls the main loop in protocol.c
     7 *
     8 * - protocol.{h, c} implements the communication to the PC
     9 * - punchcard.{h, c} implements the card model
     10 * - driver.{h, c} implements the real device driver (ISR routines and ring buffer)
    711 *
    812 * The complete program is very specific to the wiring of the microcontroller,
     
    4448#include "punchcard.h"
    4549#include "wiring.h"
    46 #include "io.h"
     50#include "protocol.h"
     51#include "driver.h"
    4752
    48 char Text1[80];
    4953
    5054static FILE uart = FDEV_SETUP_STREAM(uart_transmit, NULL, _FDEV_SETUP_WRITE);
     
    105109
    106110
    107 /**
    108  ** Interrupt routine
    109  **/
    110 
    111 
    112 ISR(PCINT1_vect) {
    113         // Called for Pin changes on Error Signals:
    114         // * PINB_ERR
    115         // * PINB_HCK
    116         // * PINB_MOCK
    117 
    118         uint8_t pinb_jetzt = PINB;
    119         uint8_t pin_changed = (pinb_jetzt ^ status.prev_pinb) & PCMSK1;
    120         uint8_t rising_edge = ((((~status.prev_pinb) & pinb_jetzt) & PCMSK1) & pin_changed) == pin_changed ? 1 : 0;
    121        
    122         char* name = "???";
    123         switch( pin_changed ) {
    124                 case (1 << PINB_ERROR):  name = "ERR"; break;
    125                 case (1 << PINB_HCK):  name = "HCK"; break;
    126                 case (1 << PINB_MOCK): name = "MOCK"; break;
    127                 case 0:
    128                         printf("Too lazy, but not "); // und jetzt nicht breaken :-)
    129                 default:
    130                         printf("Illegal PCINT1 raise: %x=>%x, %x, %x\n", status.prev_pinb, pinb_jetzt, pin_changed, rising_edge);
    131                         status.prev_pinb = pinb_jetzt;
    132                         return;
    133         }
    134 
    135         printf("%s %s\n", name, rising_edge ? "raising" : "falling");
    136 
    137         status.prev_pinb = pinb_jetzt;
    138 }
    139 
    140 
    141 ISR(PCINT2_vect) {
    142         // this routine is called for
    143         //  * PINC_IM  : Index Mark (store current column)
    144         //  * PINC_RDY : Ready (reader ready for new Pick Command)
    145         //  * PINC_BSY : Busy (card edge - there is a card)
    146         // to find out what changed, we make a backup of the former
    147         // PINC at the end of this routine.
    148 
    149         uint8_t pinc_jetzt = PINC;
    150         uint8_t pin_changed = (pinc_jetzt ^ status.prev_pinc) & PCMSK2;
    151         uint8_t rising_edge = check( pin_changed, (~status.prev_pinc) & pinc_jetzt );
    152 
    153         switch( pin_changed ) {
    154                 case (1 << PCINT_RDY):
    155                         // Ready is directly indicated by GREEN button on device.
    156                         // Pick Command is only interpreted while Ready is up.
    157                         if(rising_edge) {
    158                                 // reader got ready -- decide whether to start a new card,
    159                                 // if we hadn't started already
    160                                 if( check_pin(PINC, PINC_PC) ) {
    161                                         // we have started already...
    162                                         puts("READY rising, starting ASAP");
    163                                 } else {
    164                                         // check if there's space in the buffer to start up
    165                                         if(card_buffer_count_free() > 0) {
    166                                                 // Start.
    167                                                 // urhm... wait for user to start? user condition?
    168                                                 // yeah: quick & dirty:
    169                                                 if(status.user_instruction == START_READER) {
    170                                                         // start. BSY signal will create new card.
    171                                                         start_reader();
    172                                                 }
    173                                         }
    174                                 }
    175                                 puts("READY rising");
    176                         } else {
    177                                 // device is no more ready -- perhaps user shutdown (by button).
    178                                 puts("READY falling");
    179                         }
    180                         break;
    181                 case (1 << PCINT_BSY):
    182                         // busy =~= card edge
    183                         if(rising_edge) {
    184                                 if(current_write_card.offset != CARD_EMPTY) {
    185                                         // start a new card
    186                                         if(card_buffer_write_advance() != SUCCESS) {
    187                                                 // No more space in buffer! VERY BAD!
    188                                                 puts("BUSY rising, LOOSING DATA!");
    189                                         } else
    190                                                 printf("BUSY rising, new card %d (reader: %d)\n",
    191                                                         card_buffer.write_offset, card_buffer.read_offset);
    192                                 } else {
    193                                         puts("BUSY rising, staying card");
    194                                 }
    195                         } else {
    196                                 puts("BSY falling");
    197 
    198                                 // nochmal sicherheitshalber, wobei das sowieso viel zu spaet ist
    199                                 if( !card_buffer_count_free() ) {
    200                                         stop_reader();
    201                                 }
    202                         }
    203                         break;
    204 
    205                 case 0:
    206                         // Signal lag zu kurz an
    207                         printf("Lost Interrupt, state %x ed=%x\n", pinc_jetzt, rising_edge);
    208                         break;
    209                 default:
    210                         // illegal intterupt!
    211                         printf("Illegal interrupt! PINC was %x is %x changed %x flanke %x\n",
    212                                 status.prev_pinc, pinc_jetzt, pin_changed, rising_edge);
    213                         break;
    214         }
    215 
    216         // backup new "old" value
    217         status.prev_pinc = pinc_jetzt;
    218 } // ISR
    219 
    220 ISR(INT0_vect) {
    221         // soho... willkommen zum neuen IM-Interrupt :-)
    222         // hier koennen wir sicher sein, dass gerade eine IM-Flanke auftrat.
    223         // die wird ab 50ns gemessen :-)
    224         // die 5 Zyklen bis zur verarbeitung spielen dann eh keine Rolle mehr
    225 
    226         if( ! (PINC & (1 << PINC_BSY)) ) {
    227                 // die kann man verwerfen, keine Kartenkante
    228                 puts("IMS");
    229                 return;
    230         }
    231 
    232         if(current_write_card.offset < 0 || current_write_card.offset >= CARD_LEN ) {
    233                 puts("BAD card! Stopping reader");
    234                 if(PINC & (1 << PORTC_PC)) {
    235                         puts("Reader wasnt stopped");
    236                 }
    237                 stop_reader();
    238                 return;
    239         }
    240 
    241         // oder radikal so (ist ja genug Zeit zum Abchecken da)
    242         if( !card_buffer_count_free() )
    243                 stop_reader();
    244 
    245         // store column
    246         current_write_column =
    247                 (check_pin(PINA, PINA_D0) << COL0) |  // copy register A
    248                 (check_pin(PINA, PINA_D1) << COL1) |  // (bitwise since we don't want to
    249                 (check_pin(PINA, PINA_D2) << COL2) |  // make assumptions about bit locations)
    250                 (check_pin(PINA, PINA_D3) << COL3) |
    251                 (check_pin(PINA, PINA_D4) << COL4) |
    252                 (check_pin(PINA, PINA_D5) << COL5) |
    253                 (check_pin(PINA, PINA_D6) << COL6) |
    254                 (check_pin(PINA, PINA_D7) << COL7) |
    255 
    256                 (check_pin(PINC, PINC_D8) << COL8) |
    257                 (check_pin(PINC, PINC_D9) << COL9) |
    258                 (check_pin(PINC, PINC_D11) << COL11) |
    259                 (check_pin(PINC, PINC_D12) << COL12);
    260 
    261         // column stored. increase column counter
    262         // (correctness will be checked on next call)
    263         current_write_card.offset++;
    264 
    265         // Das war die 80. Spalte (intern 79) => finalisieren.
    266         if(current_write_card.offset == CARD_LEN) {
    267                 // diese karte ist fertig
    268                 // finalize the current card
    269                 //current_write_card.offset = CARD_READY; // unnoetig, da CARD_READY == CARD_LEN
    270                 puts("wr++");
    271 
    272                 // try to create a new card
    273                 if(card_buffer_write_advance() != SUCCESS) {
    274                         // no more space! turn off Punch Instruction!
    275                         stop_reader();
    276                         puts("No more space on buffer.");
    277                         status.reader_waits_for_space = 1;
    278                 }
    279         }
    280 
    281 
    282 
    283         // und Blinken darf er auch gerne :-)
    284         if (PINB & 0b00000001)
    285                 start_led();
    286         else
    287                 stop_led();
    288 }
    289 
    290111
    291112
  • punch-card/driver/documation-m200/src/protocol.c

    r50 r51  
    88#include <avr/pgmspace.h> // for all the strings
    99
    10 #include "io.h"
     10#include "protocol.h"
    1111#include "punchcard.h"
    1212#include "wiring.h"
     13#include "driver.h"
    1314
    1415// declare some global static string messages
     
    164165                } // if user input
    165166
    166                 // after handling user input, handle buffer
    167                 if( current_read_card.offset == CARD_READY ) {
    168                         printf("Karte in rd %d rw %d, cols rd %d rw %d\n", card_buffer.read_offset, card_buffer.write_offset,
    169                                 current_read_card.offset, current_write_card.offset);
    170 
    171                         // Karte abgearbeitet-Dingens war vorher hier (...=CARD_DONE).
    172                         // das war nicht gut.
    173 
    174                         //break; // Karte NICHT komplett ausgeben. Hier stoppen.
    175 
    176                         print_card(out_format);
    177 
    178 
    179                         // Karte abgearbeitet
    180                         current_read_card.offset = CARD_DONE;
    181 
    182                 } // karte liegt vor
    183 
    184                 if( current_read_card.offset == CARD_DONE) {
    185                         // alle karten abgearbeitet, versuche zur naechsten
    186                         // Karte zu kommen
    187                         if( card_buffer_read_advance() != SUCCESS) {
    188                                 puts("output waiting for next");
    189                         } else {
    190                                 puts("cr+");
    191                         }
    192 
    193                         // und der Writer kann jetzt auch wieder loslegen
    194                         // also eigentlich wartet hier ja der WRITER
    195                         if(status.reader_waits_for_space) {
    196                                 // leser hat auf uns gewartet (puffer war voll, leser war angehalten,
    197                                 // wir haben nun eine weitere Karte gelesen => Leser kann in dieses
    198                                 // Feld nun wieder schreiben)
    199                                 if(card_buffer_write_advance() == SUCCESS) {
    200                                         // es kann wieder weitergehen fuer den Leser
    201                                         status.reader_waits_for_space = 0;
    202                                         start_reader();
    203                                 } else {
    204                                         puts("Deadline, writer waits for reader");
    205                                 }
    206                         }
    207                 } // aktuelle Karte abgearbeitet
     167                // KARTE ABHANDELN
     168                process_buffer_queue(out_format);
    208169        } // while 1
    209170} // function
  • punch-card/driver/documation-m200/src/protocol.h

    r50 r51  
    11#ifndef __M200_IO_H__
    22#define __M200_IO_H__
     3
     4/**
     5 * AVR M200 Punch card reader controller
     6 * PC Documation M200 uC Serial Communication Protocol
     7 *
     8 * The protocol.c file implements all the stdio.h stuff (USART input/output)
     9 * and the communication with the client (PC) as well as the main loop.
     10 *
     11 * This file is part of the Punched Paper Project - Punch Card Device Drivers
     12 * Copyright (C) 2009  Sven Koeppel
     13 *
     14 * This program is free software; you can redistribute it and/or
     15 * modify it under the terms of the GNU General Public License as
     16 * published by the Free Software Foundation; either version 3 of
     17 * the License, or (at your option) any later version.
     18 *
     19 * This program is distributed in the hope that it will be useful,
     20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     22 * GNU General Public License for more details.
     23 *
     24 * You should have received a copy of the GNU General Public License
     25 * along with this program; if not, see
     26 * <http://www.gnu.org/licenses/>.
     27 **/
    328
    429
     
    833#include <stdio.h>
    934
    10 // type: char
    11 #define NO_INPUT      0
    12 
     35// Modeling the format to be used for output
    1336enum format_t {
    1437        HEX    = M200_CLIENT_HEX,
     
    1942#define is_valid_format(f) ( f == HEX || f == DEBUG || f == BINARY )
    2043
    21 static struct program_status_t {
    22         enum command_t {
    23                 START_READER,
    24                 STOP_READER
    25         } user_instruction;
    26 
    27 
    28         // for ISR
    29         uint8_t prev_pinc;
    30         uint8_t prev_pinb;
    31 
    32         uint8_t reader_waits_for_space; // also defacto der WRITER
    33 
    34 } status;
    35 
     44// A char value as return value from uart_transmit
     45#define NO_INPUT      0
    3646
    3747int uart_transmit(char c, FILE* stream);
  • punch-card/driver/documation-m200/src/wiring.h

    r50 r51  
    33
    44/**
    5  * specific things about the wiring of the uC on the board
     5 * AVR M200 Punch card reader controller
     6 * Wiring constants
     7 *
     8 * Defined symbols for the wiring of the uC on our board.
     9 * This is *very* specific to our hardware setup.
     10 *
     11 * This file is part of the Punched Paper Project - Punch Card Device Drivers
     12 * Copyright (C) 2009  Sven Koeppel
     13 *
     14 * This program is free software; you can redistribute it and/or
     15 * modify it under the terms of the GNU General Public License as
     16 * published by the Free Software Foundation; either version 3 of
     17 * the License, or (at your option) any later version.
     18 *
     19 * This program is distributed in the hope that it will be useful,
     20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     22 * GNU General Public License for more details.
     23 *
     24 * You should have received a copy of the GNU General Public License
     25 * along with this program; if not, see
     26 * <http://www.gnu.org/licenses/>.
     27 *
    628 *
    729 **/
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