Ignore:
Timestamp:
05/11/11 18:33:23 (14 years ago)
Author:
neise
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FSC/src/parser.c

    r10244 r10667  
    11#include "parser.h"
    22#include "output.h"
     3#include "application.h"
     4#include "usart.h"
    35// this method parses the data,
    46// which came in via USART
     
    7274                usart_rx_buffer[i] = 0;
    7375}
     76
     77void parse_non_human_readable_input() {
     78
     79
     80}
     81
     82// this guy checks, if an incoming byte is:
     83// to be stored, because it belongs to a command
     84// to be discarded, because something went wrong, and the bytemade no sense...
     85// the end of a commmand, and so the 'real parser' may do his work.
     86
     87void incoming_byte_parser() {
     88        static bool receiving_command = false;
     89        U08 current_byte = UDR;
     90       
     91        if (!receiving_command) {
     92                switch (current_byte) {
     93                        case 0x01:
     94                                receiving_command = true;
     95                                break;
     96                }
     97        }
     98       
     99        if (receiving_command)
     100        {
     101                usart_rx_buffer[usart_received_chars] = usart_last_char;
     102                usart_received_chars++;
     103        }
     104       
     105       
     106}
Note: See TracChangeset for help on using the changeset viewer.