📄 systick_init.c
字号:
#include <hw_sysctl.h>
#include "systick.h"
#include "tick_slot.h"
#include "sysclock_init.h"
#include "LM3S-UART0.H"
#include "uart_servo_485.h"
#include "deal_rec_data.h"
#include "timer1_isr.h"
#if 0
void tickInit (void)
{
SysTickPeriodSet((TheSysClock / TICKS_PER_SEC) -1 );
SysTickEnable();
SysTickIntEnable();
}
void systick_isr(void)
{
static unsigned short tick_slot_count = 0;
tick_slot_count++;
if((tick_slot_count!=0)&&(tick_slot_count%SEND_MASTER_BOARD_TIME_SLOT==0))//500ms
{
tick_slot_count = 0;
/*
当前时间片占用的485资源,
要确保能够在发数据之前,
485有处于接收状态,表明
上一轮数据应经发送完
*/
if(!look_up())
{
ready_send();
fill_send_slaveBuf(WORK_DATA);//填充发送缓存
/*
这里一定要确保此刻对方是处于接收状态的的
*/
/*
30ms之后切换为接收,当然这里可以考虑发送
不延时,但为了start_timer1能够统一使用
而又不影响程序的执行流程(总要切换为接受
),因此还是采用了后者
*/
start_timer1(30);
}
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -