4
0
mirror of https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git synced 2025-02-25 09:56:56 +08:00
ZhuTianlong de7bad9245 1、【创建】GIT版本仓库
2、【创建】Eclipse工程,并支持IAR插件调试
3、【创建】Keil工程,位于/RVMDK目录下
4、【创建】IAR工程,位于/EWARM目录下
5、【添加】RT-Thread1.1.1操作系统支持
6、【添加】LED1、LED2系统运行指示灯
7、【修改】Readdme.md文件

Signed-off-by: armink <armink.ztl@gmail.com>
2013-08-02 14:00:55 +08:00

123 lines
1.7 KiB
C

/*
* File : cpu.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Develop Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2006-09-06 XuXinming first version
*/
#include <rtthread.h>
#include "s3c44b0.h"
/**
* @addtogroup S3C44B0
*/
/*@{*/
/**
* This function will enable I-Cache of CPU
*
*/
void rt_hw_cpu_icache_enable()
{
rt_base_t reg;
volatile int i;
/* flush cycle */
for(i = 0x10002000; i < 0x10004800; i+=16)
{
*((int *)i)=0x0;
}
/*
* Init cache
* Non-cacheable area (everything outside RAM)
* 0x0000:0000 - 0x0C00:0000
*/
NCACHBE0 = 0xC0000000;
NCACHBE1 = 0x00000000;
/*
Enable chache
*/
reg = SYSCFG;
reg |= 0x00000006; /* 8kB */
SYSCFG = reg;
}
/**
* This function will disable I-Cache of CPU
*
*/
void rt_hw_cpu_icache_disable()
{
rt_base_t reg;
reg = SYSCFG;
reg &= ~0x00000006; /* 8kB */
SYSCFG = reg;
}
/**
* this function will get the status of I-Cache
*
*/
rt_base_t rt_hw_cpu_icache_status()
{
return 0;
}
/**
* this function will enable D-Cache of CPU
*
*/
void rt_hw_cpu_dcache_enable()
{
rt_hw_cpu_icache_enable();
}
/**
* this function will disable D-Cache of CPU
*
*/
void rt_hw_cpu_dcache_disable()
{
rt_hw_cpu_icache_disable();
}
/**
* this function will get the status of D-Cache
*
*/
rt_base_t rt_hw_cpu_dcache_status()
{
return rt_hw_cpu_icache_status();
}
/**
* this function will reset CPU
*
*/
void rt_hw_cpu_reset()
{
}
/**
* this function will shutdown CPU
*
*/
void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
while (1);
}
/*@}*/