QuakeGod
2023-02-01 4392349b649164f2b498ca5157ecd141631ea96f
Src/KMachine.c
@@ -28,18 +28,30 @@
//uint32_t * pUID = (uint32_t *)(UID_BASE);
const stKMInfoBlock KMInfoBlock =
{
   BOARD_TYPE,         //nDeviceType
   (BOARD_TYPE<<8) + BOARD_VER,         //nDeviceType    BOARD_VER,         //nDevieVer
   0x0100,         //ProgVer
   0x0100,         //KLinkVer
   0x0100,         //nCapacity
   16,               //nDInput;
   16,               //nDOutput
   0x0100,         //KBusVer
//   0x0100,         //KNetVer
//   0x0100,         //KWLVer
   4,               //nCapacity1   ?K
   1,               //nCapacity2   ?k
   DINPUT,               //nDInput;
   DOUTPUT,            //nDOutput
   0,               //nAInput
   0,               //nAOutput
   0,               //nHInput
   0,               //nHOutput
   0,               //nExt1;
   0,               //nExt2;
   0,               //nLogSize;
   0,               //nPorts;
   0,               //nManSize;
   0,               //nAbility;
   6,               //nSwitchBits;
};
const char VersionStr[] __attribute__((at(FLASH_BASE + 0X1000))) //__attribute__((at(0X8001000)))
   = "3.00";
@@ -52,33 +64,42 @@
   CFG_VER,
   0x0000,
   0x0000,
   {0,0,0,0,0,0},
   0x0000,
   {
      {
         1,
         0,
         2304,                  //Buadrate * 100;
         PortType_KLink,   //PorttType
         1,                     //ByteSize
         1,                     //Station
         2304,                  //Buadrate = * 100;
         0,                     //ByteSize
         0,                     //Parity
         0,                     //StopBits
         0,                     //endType
         0,                     //EofChar
         0,                     //SofChar
         0,                     //endtime
         0,                     //recvbuf
         0,                     //bufsize
      },
      {
         1,
         0,
         2304,                  //Buadrate * 100;
         PortType_KBus,   //PorttType
         1,                     //ByteSize
         0,                     //Station
         2304,                  //Buadrate = * 100;
         0,                     //ByteSize
         0,                     //Parity
         0,                     //StopBits
         0,                     //endType
         0,                     //EofChar
         0,                     //SofChar
         0,                     //endtime
         0,                     //recvbuf
         0,                     //bufsize
      }
   },
   {{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}},
   {{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}},
   {      //default port mapping
         0,0,0,0,0,0
   },
   0x0003,
      0x0004,
      0x0005,
@@ -89,11 +110,7 @@
      0x000a,
      0x000b,
      0x000c,
      0x000d,
      0x000e,
      0x000f,
      0x0010,
   {0},
   0x0011,
   END_SIGN,
};
@@ -190,6 +207,10 @@
}
int WriteFactoryData(void * pDataBuf, int nByteCount)
{
   stFactoryData * p1 = (stFactoryData*) pDataBuf;
   stFactoryData * p2 = (stFactoryData *)FACTORY_DATA_BASE;
   p1->Seq1= p2->Seq1+1;
   EraseAndWriteToFlashMem(pDataBuf, (stFactoryData *)FACTORY_DATA_BASE,nByteCount);
   return 0;
}