| | |
| | | #include "../src/Ethernet/loopback.h"
|
| | | #elif (BOARD_TYPE == 14)
|
| | | #include "FP0.h"
|
| | | #elif (BOARD_TYPE == 15)
|
| | | #elif (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | #include "KWireless.h"
|
| | | //#include "user.h"
|
| | | //#include "../src/radio/inc/sx126x-board.h"
|
| | |
| | | /* USER CODE END Includes */
|
| | |
|
| | | /* Private variables ---------------------------------------------------------*/
|
| | | #define ADCrefAddr 0x1FFFF7BA
|
| | |
|
| | | /* USER CODE BEGIN PV */
|
| | | /* Private variables ---------------------------------------------------------*/
|
| | |
|
| | |
| | | SystemClock_Config();
|
| | |
|
| | | /* USER CODE BEGIN SysInit */
|
| | | TickFreq=10000; //TickƵ��
|
| | | TickFreq=10000; //Tick频率
|
| | | InituS(TickFreq);
|
| | | // HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/TickFreq); //���¶���SysTick��Ƶ���
|
| | | // HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/TickFreq); //重新定义SysTick的频率�
|
| | |
|
| | | /* USER CODE END SysInit */
|
| | |
|
| | |
| | | else{bKBusMaster=0;bKBusSlave=1;}
|
| | | nChilds=nAddr;
|
| | | FP0_Init();
|
| | | #elif (BOARD_TYPE == 15)
|
| | | #elif (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | nAddr=KMem.EffJumperSW&0x0f;
|
| | | if (KMem.EffJumperSW == 0x1f) {bKBusRepeater=1;bKBusMaster=1;bKBusSlave=0;}
|
| | | else if ((KMem.EffJumperSW&0x10)!=0) {bKBusMaster=1;bKBusSlave=0;}
|
| | |
| | | #endif
|
| | |
|
| | | if (GetBoardType() == 7 || GetBoardType() ==8
|
| | | || GetBoardType() == 9 || GetBoardType() ==10 ||GetBoardType() ==13 ||GetBoardType() ==15 ) |
| | | || GetBoardType() == 9 || GetBoardType() ==10 ||GetBoardType() ==13 ||GetBoardType() ==15 || BOARD_TYPE == 16) |
| | | {
|
| | | displayInput(0xffff); //
|
| | | EnableDisIn(1); //Input Diaplay Enable 595
|
| | |
| | | StartPLC();
|
| | | }
|
| | | KMem.WX[7]=0x5a;
|
| | | #if (BOARD_TYPE == 15)
|
| | | KWireLessInit(KMem.EffJumperSW&0x20);
|
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | KWireLessInit(KMem.EffJumperSW&0x20,KMem.EffJumperSW&0x1f);
|
| | | KWireLessStart();
|
| | | #endif
|
| | |
|
| | |
| | | #endif
|
| | |
|
| | | if (GetBoardType() == 7 || GetBoardType() ==8
|
| | | || GetBoardType() == 9 || GetBoardType() ==10 || GetBoardType() ==15) |
| | | || GetBoardType() == 9 || GetBoardType() ==10 || GetBoardType() ==15 || GetBoardType() ==16) |
| | | {
|
| | | displayInput(KMem.WX[0]);
|
| | | }
|
| | |
| | | }
|
| | | //*/
|
| | |
|
| | | #if (BOARD_TYPE == 15)
|
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | Radio.IrqProcess( ); // Process Radio IRQ
|
| | | #endif
|
| | |
|
| | |
| | | if (bKBusSlave)
|
| | | {
|
| | | // BufferOut[0]=KMem.WX[0];
|
| | | #if (BOARD_TYPE == 15)
|
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | // KBusSlaveFunc(2);
|
| | | // if (! KMem.RunStat) {BufferIn[0]=0;}
|
| | | // KMem.WY[0]=BufferIn[0];
|
| | |
| | | #endif
|
| | | //PutOutput (KMem.nRunCount>>8);
|
| | | //PutOutput(0x0f70);
|
| | | #if (BOARD_TYPE == 15) |
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16) |
| | | // KMem.WY[1]=KMem.nRunCount>>6;
|
| | | KMem.WY[1]=KMem.WX[0];
|
| | | KMem.WY[0]=KMem.WX[1];
|