Real2Virtual202111

٤Ƴ٤Ĥ
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
-
|
!
 
 
-
|
|
|
|
|
|
!
 
 
 
-
|
|
|
|
|
|
|
-
!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
-
!
//#ifndef INBUFFER_H
//#define INBUFFER_H
#pragma once
 
#include "common.h"
/* 
class CommandBuffer{
    public:
        ackReturned(unsigned char faceID);
        putQueue(unsigned char faceID, char *x, int len);
        putChar(unsigned char faceID, char x);
}
 */
#include "CommandBuffer.h"
class CommandBuffer;
 
class InBuffer{
private:
   unsigned char faceID;         /* input channel ID */
   unsigned char (*getPort)(void); /* get port value (photo tr input) */
   void (*setPortMode)(unsigned char s); /* set portmode 0...output, 1...input */
   unsigned char now;               /* current input */
   unsigned char last;              /* last input */
   unsigned char p;                 /* current input bits position*/
//   volatile unsigned char bits[MaxBits/8+1];          /* sampled binary input sequence */
   unsigned char bits[MaxBits];          /* sampled binary input sequence */
   unsigned char status;            /* 0:waiting for the input  1: reading  2:stop 3: input with over writing */
   unsigned char sampleInterval;           /* sampling interval for the timer interrupt*/
   unsigned char sampleIntervalCounter; /* counter for the sampling interval of the timer interrupt */
   unsigned char sampleIntForDecode;    /* sampling interval for the bits*/
   unsigned char cin;
   int inlen;
   char inputBuffer[MaxInterFaceStrLen]; /* serial input command buffer */
   unsigned char nextDoorDirection;
   unsigned char correspondingLEDNo;
   unsigned char nextDoorFaceID;
   unsigned char connected;
   CommandBuffer *command;
   unsigned char cbp; /* command buffer pointer */
public:
   InBuffer(unsigned char id, CommandBuffer *com);
   void setPortConf( unsigned char (*getfun)(void), void (* modefun)(unsigned char x)); /* set the input port*/
   void intrProcess(void);  /* interrupt process */
   void setStatus( unsigned char x); /* */
   unsigned char getStatus(void);
   unsigned char decode(void);       /* decode the bits into char */
   unsigned char getChar(void);      /* get the char , if it is 0 then, no input*/
   unsigned char getConnected(void);
   int getNextDoorDirection(void);
   void parse(unsigned char c); /* serial input parser (L2)*/
   unsigned char startWith(char *c);
   void shiftLeft( unsigned char i);
   void returnAck(void);
   void setCommand(CommandBuffer *x);
   void setConnected(unsigned char x);
}; 
//#endif
 

Counter: 17, today: 1, yesterday: 0

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2021-12-05 (日) 16:27:37 (173d)