// *****************************************************************************
// SysTickIntHandler
// Called By the SysTick Interrupt
// *****************************************************************************
void SysTickIntHandler(void)
{
	// Keep track of time!
	Time_Task();

	#ifdef SOLDERBRIDGES_ENABLED
		SolderBridge_Task();

		ExtGpio_Task();
	#endif

	#ifdef SERIAL_ENABLED
		Serial_Task();
	#endif

	#ifdef SPLASHPIXEL_ENABLED
		SP_Task();
	#endif

	ColourModeTick();

	// Service the Ethernet and TCP Stack
	Ethernet_Task();

	// Measure any analogue inputs
	AdcTask();

	#ifdef LOGIC_ENABLED
		// The Logic task handles all of the if 'this' then 'that' functionality
		LogicTask();
	#endif

}
Example #2
0
void maintask ( void )
{
    static unsigned char checknum = 0xff, checked = 0;
    ModuLenNumStruct *p_modu;
    p_modu = &ModuTemp;

    if ( AdcTimeTask >= AdcTimeTaskFlg )
        {
            ModuCheckFlg += 1;
            AdcTimeTask = 0;
            AdcTask();
#ifdef vhe01

            if ( P40 )
                {
                    P40 = 0;
                }

            else
                {
                    P40 = 1;
                }

#else

            if ( P15 )
                {
                    P15 = 0;
                }

            else
                {
                    P15 = 1;
                }

#endif
        }

    if ( Uart1TimeTask >= Uart1TimeTaskFlg )
        {
            Uart1TimeTask = 0;

            if ( indexmk > 0x0a )
                {
                    indexmk = 0x01;
                }

            Inquire ( indexmk );
            *p_modu = I2cSwitchModu ( indexmk );

            if ( UartRcvFrame.len == 0 && p_modu->Online == 1 ) //ʧ°Ü
                {
                    checknum = indexmk;
                    checked++;

                    if ( checked > 3 )
                        {
                            p_modu->Online = 0;
                            MainModu.Inserted &= ~ ( 0x01 << ( indexmk - 1 ) );
                            checked = 0;
                            checknum = 0xff;
                            indexmk++;
                        }
                }

            else
                {
                    if ( checknum == indexmk )
                        {
                            checked = 0;
                        }

                    indexmk++;
                }
        }

    if ( I2cTimeTask >= I2cTimeTaskFlg )
        {
            _SYS_RESET_CPU();
            I2cTimeTask = 0;
        }
}