/*
 * @Author: mbw
 * @Date: 2024-12-07 15:13:24
 * @LastEditors: mbw && 1600520629@qq.com
 * @LastEditTime: 2024-12-16 14:54:45
 * @FilePath: \ble_-tyq_-bjq_-ch584-m\bsp\src\bsp_tim.c
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
 */
#include "bsp_tim.h"
#include "HAL.h"


// tick_1ms_cnt��SysTick_Handler()��1ms +1
volatile uint32_t tick_1ms_cnt = 0;

/**
 * @description: ��SysTick��1ms��Ϊ����
 * @return {uint32_t}
 */
uint32_t BSP_Get_Tick(void)
{
    /* Platform implementation */
    // return tick_1ms_cnt;
    return (TMOS_GetSystemClock() / 1.6);
}


// SysTick�жϺ���
__INTERRUPT
__HIGH_CODE
void SysTick_Handler()
{
    static uint8_t cnt_ms = 0;

    SysTick->SR = 0;    // ����жϱ�־
    tick_1ms_cnt++;

    cnt_ms++;
}

