前面的案例中有很多的小伙伴都私信我关于delay_other.c和delay_other.h头文件的源码。
在这里就直接分享出来。
-------------------------------------------------------------------------------------------
主要就是这四个文件。
-------------------------------------------------------------------------------------------
1. sys_other.c
#include "sys_other.h"
void NVIC_Configuration(void)
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
}
2. sys_other.h
#ifndef __SYS_H
#define __SYS_H
#include "stm32f10x.h"
//0,不支持ucos
//1,支持ucos
#define SYSTEM_SUPPORT_UCOS 0 //定义系统文件夹是否支持UCOS
//位带操作,实现51类似的GPIO控制功能
//具体实现思想,参考<<CM3权威指南>>第五章(87页~92页).
//IO口操作宏定义
#define BITBAND(addr, bitnum) ((addr & 0xF000