/* This function will init timer4 for system ticks  */
static void rt_hw_timer_init(void)
/* This function will init timer4 for system ticks  */
static void rt_hw_timer_init(void)
{
    TCFG0 &= 0xffff00ff;
    TCFG0 |= 15 << 8;
    TCFG1  &= 0xfff0ffff;
    TCFG1  |= 0x00010000;
    TCNTB4 = (rt_int32_t)(PCLK / (4 *16* RT_TICK_PER_SECOND)) - 1;
    TCON = TCON & (~(0x0f<<20)) | (0x02<<20);
    rt_hw_interrupt_install(INTTIMER4, rt_timer_handler, RT_NULL, "tick");
    rt_hw_interrupt_umask(INTTIMER4);
    TCON = TCON & (~(0x0f<<20)) | (0x05<<20);
 }