State_Machine.#1
上传用户:gxz1972
上传日期:2019-09-13
资源大小:323k
文件大小:19k
- //-----------------------------------------------------------------------------
- // USB_ISR.c
- //-----------------------------------------------------------------------------
- // Copyright 2007 Vson Technology, Inc.
- // http://www.usbmcu.com
- //
- // Program Description:
- //
- //
- //
- //
- //
- // MCU: C8051F347
- // Tool chain: Keil C51 7.50 / Keil EVAL C51
- // Silicon Laboratories IDE version 2.6
- // Command Line:
- // Project Name: TR1000
- //
- //
- // Release 1.0
- // -All changes by Brin Cai
- // -24 JUL 2007
- //
- //
- //update date: 2007.08.13 ADC solution bit change(10bit--->12bit)
- //-----------------------------------------------------------------------------
- // Includes
- //-----------------------------------------------------------------------------
- #include "Include_H.h"
- //-----------------------------------------------------------------------------
- // State_Machine
- //-----------------------------------------------------------------------------
- //
- // Return Value : None
- // Parameters : None
- //
- // Determine new state and act on current state
- //-----------------------------------------------------------------------------
- void State_Machine(void)
- {
-
-
- switch (M_State)
- {
- case
- USB_RESET_STATUS:
- EA = 0;
- USBReset();
- M_State = WAIT_OPEN_DEVICE_STATUS;
- EA = 1;
- break;
-
- case
- EP0_HANDLER_STATUS: // Stay in Wait State
- EA = 0;
- Endpoint0();
- EA = 1;
- break;
- case
- WAIT_OPEN_DEVICE_STATUS: // Stay in Wait State
- break;
- case
- DEVICE_IDLE_STATUS: // Stay in Idle State
- break;
-
-
- case
- RX_CONFIG_DATA_FROM_HOST_STATUS: // Receive the Config Data
-
- //if (bitInterruptFlag == 1)
- {
- EA = 0;
- RxConfigDataFromHost();//BulkOrInterruptOut(&gEp2OutStatus);//EP2 Out Status
- EA = 1;
- M_State = TX_CONFIG_RESPONSE_TO_HOST_STATUS;
- }
- break;
- case
- TX_CONFIG_RESPONSE_TO_HOST_STATUS: // Response Host After receive the Config Data
- //if (bitInterruptFlag == 1)
- {
- EA = 0;
- TxConfigResponse2Host(0x00);
- EA = 1;
- M_State = DEVICE_IDLE_STATUS;
- //bitInterruptFlag = 0;
- }
- break;
- case
- TX_TEACHER_KEY_DATA_TO_HOST_STATUS: // transmit key data to the host
- if (gbitRfReceivedDataFlag == 1)
- {
- EA = 0;
- TxTeacherKeyData2Host();
- EA = 1;
- //M_State = TX_TOUCHPAD_DATA_TO_HOST_STATUS;
- gbitRfReceivedDataFlag = 0;
- }
- break;
- case
- TX_TOUCHPAD_DATA_TO_HOST_STATUS: // transmit touch pad data to the host
- //if (bitInterruptFlag == 1)
- if (gbitRfReceivedDataFlag == 1)
- {
- EA = 0;
- TxTouchPadData2Host();
- EA = 1;
- //M_State = TX_CONFIG_RESPONSE_TO_HOST_STATUS;
- gbitRfReceivedDataFlag = 0;
- }
- break;
- case
- TX_STUDENT_KEY_DATA_TO_HOST_STATUS: // transmit key data to the host
- if (gbitRfReceivedDataFlag == 1)
- {
- EA = 0;
- TxStudentKeyData2Host();
- EA = 1;
- //M_State = TX_TOUCHPAD_DATA_TO_HOST_STATUS;
- gbitRfReceivedDataFlag = 0;
- }
- break;
- case
- TX_STUDENT_EXAM_DATA_TO_HOST_STATUS: // transmit key data to the host
- if (gbitRfReceivedDataFlag == 1)
- {
- EA = 0;
- TxStudentExamData2Host();
- EA = 1;
- //M_State = TX_TOUCHPAD_DATA_TO_HOST_STATUS;
- gbitRfReceivedDataFlag = 0;
- }
- break;
-
- default:
- //M_State = ERROR_STATUS; // Unknown State, stay in Error State
- break;
- }//switch
-
- }
- void TxConfigResponse2Host(unsigned char ResponseResult)
- {
- data BYTE i;
- sbitLED = 0;
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- gaucTxData2HostBuffer[0] = 0x00;
- gaucTxData2HostBuffer[1] = 0x04;//单包传输 最后一个分包 12 字节
- gaucTxData2HostBuffer[2] = ResponseResult;
- gaucTxData2HostBuffer[3] = 2;
- gaucTxData2HostBuffer[4] = 0;
- gaucTxData2HostBuffer[5] = 0;
- gaucTxData2HostBuffer[6] = 7;
- gaucTxData2HostBuffer[7] = 1;
- gaucTxData2HostBuffer[8] = 0;
- gaucTxData2HostBuffer[9] = 1;
- gaucTxData2HostBuffer[10] = 0;
- gaucTxData2HostBuffer[11] = 0x55;
- // Place Config response packet (0x00) on the OUT FIFO
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64);
- sbitLED = 1;
- }
- void TxTeacherKeyData2Host(void)
- {
- data BYTE i;
- sbitLED = 0;
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- /*
- gaucTxData2HostBuffer[0] = 0x01;
- gaucTxData2HostBuffer[1] = 0x30;//单包传输 最后一个分包 12 字节
- gaucTxData2HostBuffer[2] = 0xaa;
- gaucTxData2HostBuffer[3] = 0x55;
- gaucTxData2HostBuffer[4] = 0xaa;
- gaucTxData2HostBuffer[5] = 0x55;
- gaucTxData2HostBuffer[6] = 0x00;
- gaucTxData2HostBuffer[7] = 0x01;
- gaucTxData2HostBuffer[8] = 0xaa;
- gaucTxData2HostBuffer[9] = 0x55;
- gaucTxData2HostBuffer[10] = 0xaa;
- gaucTxData2HostBuffer[11] = 0x55;
- gaucTxData2HostBuffer[12] = 0x00;
- gaucTxData2HostBuffer[13] = 0x01;
- */
- gaucTxData2HostBuffer[0] = 0x01;
- gaucTxData2HostBuffer[1] = 0x14;
- if ((gaucRxDataFromRfBuffer[COUNT_BASE + (COUNT_BASE + RF_PADLOAD)*0 + 0] & BIT7) == BIT7)
- {
- gaucTxData2HostBuffer[2] = 0x80;
- }
- else
- {
- gaucTxData2HostBuffer[2] = 0x00;
- }
-
- gaucTxData2HostBuffer[3] = gaucRxDataFromRfBuffer[2] & 0x7f;
- gaucTxData2HostBuffer[4] = gaucRxDataFromRfBuffer[3];
- gaucTxData2HostBuffer[5] = gaucRxDataFromRfBuffer[4];
- gaucTxData2HostBuffer[6] = gaucRxDataFromRfBuffer[7];
- gaucTxData2HostBuffer[7] = gaucRxDataFromRfBuffer[8];
-
- if (gaucRxDataFromRfBuffer[6] != gucPacketCount)
- {
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64);
- gucPacketCount = gaucRxDataFromRfBuffer[6];
- }
- sbitLED = 1;
-
- }
- void TxTouchPadData2Host(void)
- {
- data BYTE i;
- sbitLED = 0;
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- /*
- gaucTxData2HostBuffer[0] = 0x02;
- gaucTxData2HostBuffer[1] = 0x14;
- gaucTxData2HostBuffer[2] = 0x00;
- gaucTxData2HostBuffer[3] = 0x01;
- gaucTxData2HostBuffer[4] = 0x00;
- gaucTxData2HostBuffer[5] = 0x01;
- gaucTxData2HostBuffer[6] = 0x00;
- */
- gaucTxData2HostBuffer[0] = 0x02;
- gaucTxData2HostBuffer[1] = 0x14;
- if ((gaucRxDataFromRfBuffer[COUNT_BASE + (COUNT_BASE + RF_PADLOAD)*0 + 0] & BIT7) == BIT7)
- {
- gaucTxData2HostBuffer[2] = 0x80;
- }
- else
- {
- gaucTxData2HostBuffer[2] = 0x00;
- }
- gaucTxData2HostBuffer[3] = gaucRxDataFromRfBuffer[2] & 0x7f;
- gaucTxData2HostBuffer[4] = gaucRxDataFromRfBuffer[3];
- gaucTxData2HostBuffer[5] = gaucRxDataFromRfBuffer[4];
- gaucTxData2HostBuffer[6] = gaucRxDataFromRfBuffer[5] & 0x0f;//0x03;//(10bit-->12bit)
- gaucTxData2HostBuffer[7] = gaucRxDataFromRfBuffer[6];
- gaucTxData2HostBuffer[8] = gaucRxDataFromRfBuffer[7] & 0x0f;//0x03;//(10bit-->12bit)
- gaucTxData2HostBuffer[9] = gaucRxDataFromRfBuffer[8];
- if ((gaucRxDataFromRfBuffer[5] & BIT6) == BIT6)
- gaucTxData2HostBuffer[10] = 0x01;
- else
- gaucTxData2HostBuffer[10] = 0x00;
- if ((gaucRxDataFromRfBuffer[5] & BIT5) == BIT5)
- gaucTxData2HostBuffer[10] |= BIT1;
- else
- gaucTxData2HostBuffer[10] &= ~BIT1;
-
- //BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64);
- if (gaucTxData2HostBuffer[3] != gucPacketCount)
- {
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64);
- gucPacketCount = gaucTxData2HostBuffer[3];
- }
- sbitLED = 1;
- }
- /*
- //=============================================================================================
- void TxStudentKeyData2Host(void)
- {
- data BYTE i;
- sbitLED = 0;
-
-
- gaucTxData2HostBuffer[0] = 0x03; //student key data
- gaucTxData2HostBuffer[1] = 0x14;
- if ((gaucRxDataFromRfBuffer[COUNT_BASE + (COUNT_BASE + RF_PADLOAD)*0 + 0] & BIT7) == BIT7)
- {
- gaucTxData2HostBuffer[2] = 0x80;
- }
- else
- {
- gaucTxData2HostBuffer[2] = 0x00;
- }
-
- //最高位用于区别学生机和教师机 bit7-- 1:教师机地址 0:学生机地址
- gaucTxData2HostBuffer[3] = gaucRxDataFromRfBuffer[2] & 0x7f;
- gaucTxData2HostBuffer[4] = gaucRxDataFromRfBuffer[3];
- gaucTxData2HostBuffer[5] = gaucRxDataFromRfBuffer[4];
- //收集数据阶段
- if ((gaucRxDataFromRfBuffer[5] & 0x3f) != gucPacketCount)
- {
- if (gaucRxDataFromRfBuffer[6] != 0)
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[6];
- }
- if (gaucRxDataFromRfBuffer[7] != 0)
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[7];
- }
- if (gaucRxDataFromRfBuffer[8] != 0)
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[8];
- }
-
- //收据数据阶段,最后一个包不存储包序号
- //if ((gaucRxDataFromRfBuffer[5] & BIT7) == BIT7) //bit7=1 有后续包
- {
- gucPacketCount = (gaucRxDataFromRfBuffer[5] & 0x3f);
- }
-
-
- //发送数据阶段:有最后一个包标志,且包序号不同,则发送数据
- if ((gaucRxDataFromRfBuffer[5] & BIT7) != BIT7)
- {
- //if ((gaucRxDataFromRfBuffer[5] & 0x3f) != gucPacketCount)
- {
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64);
- //gucPacketCount = (gaucRxDataFromRfBuffer[5] & 0x3f);
- gucStudentKeyDataCount = 6;
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- }
- }//if
- }
-
-
-
- sbitLED = 1;
-
- }//end of void TxStudentKeyData2Host(void)
- */
- //=============================================================================================
- void TxStudentKeyData2Host(void)
- {
- data BYTE i;
-
- bit bitNewDataPacketFlag = 0;
-
- sbitLED = 0;
-
-
- //收集数据阶段
- bitNewDataPacketFlag = CompareStudentIdandPacketCount();
-
- //bitNewDataPacketFlag = 1;
- if ( bitNewDataPacketFlag )
- {
- bitNewDataPacketFlag = 0;
- InsertNewId();
- if ( (gaucRxDataFromRfBuffer[5] & BIT7) == BIT7 ) //不是最后一包
- {
- SaveFirtstPacketData();
- }//if
-
-
- //发送数据阶段:有最后一个包标志,且包序号不同,则发送数据
- else
- //if ( (gaucRxDataFromRfBuffer[5] & BIT7) != BIT7 ) //是最后一包
- {
-
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- gucStudentKeyDataCount = 6;
- gaucTxData2HostBuffer[0] = 0x03; //student key data
- gaucTxData2HostBuffer[1] = 0x14;
- if ((gaucRxDataFromRfBuffer[COUNT_BASE + (COUNT_BASE + RF_PADLOAD)*0 + 0] & BIT7) == BIT7)
- {
- gaucTxData2HostBuffer[2] = 0x80;
- }
- else
- {
- gaucTxData2HostBuffer[2] = 0x00;
- }
-
- //最高位用于区别学生机和教师机 bit7-- 1:教师机地址 0:学生机地址
- gaucTxData2HostBuffer[3] = gaucRxDataFromRfBuffer[2] & 0x7f;
- gaucTxData2HostBuffer[4] = gaucRxDataFromRfBuffer[3];
- gaucTxData2HostBuffer[5] = gaucRxDataFromRfBuffer[4];
-
-
- if (0 != gaucStudentIdBuffer[gpucStudentIdBufferPoint][3])
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucStudentIdBuffer[gpucStudentIdBufferPoint][3];
- }
- if (0 != gaucStudentIdBuffer[gpucStudentIdBufferPoint][4])
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucStudentIdBuffer[gpucStudentIdBufferPoint][4];
- }
- if (0 != gaucStudentIdBuffer[gpucStudentIdBufferPoint][5])
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucStudentIdBuffer[gpucStudentIdBufferPoint][5];
- }
- if (gaucRxDataFromRfBuffer[6] != 0)
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[6];
- }
- if (gaucRxDataFromRfBuffer[7] != 0)
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[7];
- }
- if (gaucRxDataFromRfBuffer[8] != 0)
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[8];
- }
-
- gaucTxData2HostBuffer[13] = (gaucRxDataFromRfBuffer[5] & 0x3f);
-
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64);
-
-
- ClearCurrentFirstPacketData();
- }//else
- }//if
-
-
-
- sbitLED = 1;
-
- }//end of void TxStudentKeyData2Host(void)
- //=============================================================================================
- void TxStudentExamData2Host(void)
- {
- data BYTE i;
- sbitLED = 0;
-
-
- gaucTxData2HostBuffer[0] = 0x04; //student Exam data
- //gaucTxData2HostBuffer[1] = 0x14;
- if ((gaucRxDataFromRfBuffer[COUNT_BASE + (COUNT_BASE + RF_PADLOAD)*0 + 0] & BIT7) == BIT7)
- {
- gaucTxData2HostBuffer[2] = 0x80;
- }
- else
- {
- gaucTxData2HostBuffer[2] = 0x00;
- }
- if (gucStudentKeyDataCount == 6) //数据包的第一个数据记录学生机ID号
- {
- gaucTxData2HostBuffer[3] = gaucRxDataFromRfBuffer[2] & 0x7f;
- gaucTxData2HostBuffer[4] = gaucRxDataFromRfBuffer[3];
- gaucTxData2HostBuffer[5] = gaucRxDataFromRfBuffer[4];
- }
- if (gaucTxData2HostBuffer[5] != gaucRxDataFromRfBuffer[4]) //ID变化,学生交卷被其他学生干扰
- {
- gucStudentKeyDataCount = 6; //重新收集数据
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- }
-
- if ((gaucRxDataFromRfBuffer[5] & 0x3f) != gucPacketCount) //包序号相同,则丢弃
- {
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[5] & 0x3f;//| 0xc0;
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[6];
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[7];
- gaucTxData2HostBuffer[gucStudentKeyDataCount++] = gaucRxDataFromRfBuffer[8];
-
- if ((gaucRxDataFromRfBuffer[5] & BIT7) == BIT7) //bit7=1 有后续包
- {
- gucPacketCount = (gaucRxDataFromRfBuffer[5] & 0x3f); //有后续包,则记录包序号
- if (gucStudentKeyDataCount == 62)
- {
- gbitBulkMultiPackageTxFlag = 1;
- gaucTxData2HostBuffer[1] = 61;
- gaucTxData2HostBuffer[1] <<= 2;
- gaucTxData2HostBuffer[1] |= BIT0; //bit 0--0:单包传输, 1:分包传输
- gaucTxData2HostBuffer[1] |= BIT1; //bit 1--0:最后一个分包,1:有后续包
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64); //上传数据
- gucPacketCount = (gaucRxDataFromRfBuffer[5] & 0x3f); //记录包序号
- gucStudentKeyDataCount = 6; //下一包数据从gaucTxData2HostBuffer[6]开始存储
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }//for
- }//if
- }//if
-
-
- }//if
-
- if ((gaucRxDataFromRfBuffer[5] & BIT7) != BIT7) //包序号第7位,bit7=0-无后续包 bit7=1-有后续包
- {
- if ((gaucRxDataFromRfBuffer[5] & 0x3f) != gucPacketCount) //无后续包且包序号不等,则上传数据
- {
- gaucTxData2HostBuffer[1] = 61;
- gaucTxData2HostBuffer[1] <<= 2;
- if (gbitBulkMultiPackageTxFlag == 1)
- {
- gaucTxData2HostBuffer[1] |= BIT0; //bit 0--0:单包传输, 1:分包传输
- }
- else
- {
- gaucTxData2HostBuffer[1] &= ~BIT0; //bit 0--0:单包传输, 1:分包传输
- }
- gaucTxData2HostBuffer[1] &= ~BIT1; //bit 1--0:最后一个分包,1:有后续包
- BulkOrInterruptIn (&gEp1InStatus, (BYTE*)&gaucTxData2HostBuffer, 64); //上传数据
- gucPacketCount = (gaucRxDataFromRfBuffer[5] & 0x3f); //记录包序号
- gucStudentKeyDataCount = 6; //下一包数据从gaucTxData2HostBuffer[6]开始存储
- for (i = 0; i < 64; i++)
- {
- gaucTxData2HostBuffer[i]=0;
- }
- }
- }
-
- sbitLED = 1;
-
- }//end of void TxStudentExamData2Host(void)
- //=============================================================================================
- //接收频道配置数据:4 Byte
- //=============================================================================================
- void RxConfigDataFromHost(void)
- {
- data BYTE i;
- BulkOrInterruptOut(&gEp2OutStatus);//EP2 Out Status
- if (gaucTempStorage[0] == 0x00 )
- {
- for (i=0; i<4; i++)
- {
- gaucRfConfigData0[i] = gaucTempStorage[i+2];
- gaucRfConfigData0[i] <<= 1;
- gaucRfConfigData0[i] |= BIT0;//接收模式
- }
-
- RF_DATA_PORT_OUT_INITIAL;
- //Initial();
- nRF2401Configuration();
- RF_DATA_PORT_IN_INITIAL;
- }
- }//end of RxConfigDataFromHost
- //=============================================================================================
- //比较ID号和包序号 返回值:1.bitNewDataPacketFlag 2. 缓冲器指针gpucStudentIdBufferPoint
- //=============================================================================================
- bit CompareStudentIdandPacketCount(void)
- {
- data BYTE i;
- //data BYTE j;
- bit bitNewDataPacketFlag = 0;
-
- for (i=0; i<20; i++)
- {
-
- if ( (0 == gaucStudentIdBuffer[i][0]) && (0 == gaucStudentIdBuffer[i][1]) )
- {
- //比较到队尾,没有相等的,说明是新数据
- gpucStudentIdBufferPoint = i;
- bitNewDataPacketFlag = 1;
- break;
-
- }//if
-
- else
- {
- if ( (gaucStudentIdBuffer[i][0] == gaucRxDataFromRfBuffer[3])
- && (gaucStudentIdBuffer[i][1] == gaucRxDataFromRfBuffer[4]) )
- {
- if (gaucStudentIdBuffer[i][2] == (gaucRxDataFromRfBuffer[5] & 0x3f) )
- {
- bitNewDataPacketFlag = 0;
- break;
- }
- else
- {
- bitNewDataPacketFlag = 1;
- gpucStudentIdBufferPoint = i;
- break;
- }
- }
-
- }//else
-
- }//for
-
- return bitNewDataPacketFlag;
- }//end of CompareStudentIdandPacketCount
- //=============================================================================================
- //插入新Id和数据
- //=============================================================================================
- void InsertNewId(void)
- {
- //data BYTE i;
- //data BYTE j;
-
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][0] = gaucRxDataFromRfBuffer[3]; //ID号 高字节
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][1] = gaucRxDataFromRfBuffer[4]; //ID号 低字节
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][2] = gaucRxDataFromRfBuffer[5] & 0x3f; //包序号
- }//end of InsertNewIdandData
- void SaveFirtstPacketData(void) //分包传输时,保存第一包数据
- {
- //data BYTE i;
- //data BYTE j;
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][3] = gaucRxDataFromRfBuffer[6]; //data
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][4] = gaucRxDataFromRfBuffer[7]; //data
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][5] = gaucRxDataFromRfBuffer[8]; //data
- }//end of InsertNewIdandData
- void ClearCurrentFirstPacketData(void)
- {
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][3] = 0; //data
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][4] = 0; //data
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][5] = 0; //data
- }
- void ClearStudentIdBuffer(void)
- {
- data BYTE i;
- data BYTE j;
- for (i=0; i<20; i++)
- {
- for (j=0; j<6; j++)
- {
- gaucStudentIdBuffer[i][j] = 0;
- }
- }
- } //end of ClearStudentIdBuffer
- /*
- void ClearCurrentStudentIdandData(void)
- {
- data BYTE i;
- for (i=0; i<6; i++)
- {
- gaucStudentIdBuffer[gpucStudentIdBufferPoint][i] = 0;
- }
- }
- */
- //-----------------------------------------------------------------------------
- // End Of File
- //-----------------------------------------------------------------------------