| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- /********************************** (C) COPYRIGHT *******************************
- * File Name : main.c
- * Author : Wingcool
- * Version : V1.0.0
- * Date : 2024/01/05
- * Description : Main program body.
- *********************************************************************************/
- #include "include.h"
- #include "GoodixTouch.h"
- #include "HidReport.h"
- #include "usb_com.h"
- #include "MS928x.h"
- #include "uart_transfer.h"
- /*********************************************************************
- * @fn main
- *
- * @brief Main program.
- *
- * @return none
- */
- void touch_init(void)
- {
- tmos_init();
- //#if AUTO_TEST
- // AutoTestInit();
- //#endif
- Touch_IIC_Init();
- #if USBCONFIG
- ConfigInit();
- uart_transfer_init(9600);
- #else
- uart_transfer_init(9600);
- #endif
- //
- // //CheckFlag();
- //
- MS928XInit();
- CHIP_TYPE chip_type = GetChipTypeFromFlash();
- if(IsBerlinSeries())
- {
- if(!IsBerlinChipType(chip_type) || chip_type==CHIP_TYPE_UNKNOW)
- {
- ChipType = CHIP_TYPE_BERLIND;
- }
- else
- {
- ChipType = chip_type;
- }
- isBerlinSeries = TRUE;
- }
- else
- {
- if(IsBerlinChipType(chip_type) || chip_type==CHIP_TYPE_UNKNOW)
- {
- ChipType = CHIP_TYPE_9XXX;
- }
- else
- {
- ChipType = chip_type;
- }
- isBerlinSeries = FALSE;
- }
- if(chip_type==CHIP_TYPE_UNKNOW)
- {
- IICTouchInit();
- // if(config.intf == EN_USB_IIC)
- // {
- // SoftResetChip();
- // }
- #if USB_EN
- dev_init(40, 40);
- usb_init();
- usb_device_init();
- #endif // USB_EN
- }
- else
- {
- // ChipType = CHIP_TYPE_BERLINB;
- PRINT("Chip type in flash is %d\n", chip_type);
- #if USB_EN
- dev_init(40, 40);
- usb_init();
- usb_device_init();
- #endif // USB_EN
- // if(config.intf == EN_USB_IIC)
- // {
- // while(UsbReportPosEn == FALSE);
- // }
- IICTouchInit();
- }
- PRINT("Initial finish\n");
- }
- void touch_process(void)
- {
- #if AUTO_TEST
- AutoTestHandle();
- #endif
- //CheckUart0Comand();
- // CheckTouchInt();
- CommandHandle();
- TMOS_SystemProcess();
- }
|