Files
TC264_Library_seekfree/Example/1-ADC_Demo/USER/Cpu0_Main.c
SEEKFREE_Kang c1083dc65f V1.0.4
默认勾选上生成HEX的功能
 对Cpu1_Main.c中的core1_main函数默认添加 开启总中断的函数。
 修复CPU1无法响应中断的问题
 删除汇编中的包含路径信息
 修复总钻风小分辨只采集一次的问题
 添加RDA5807 FM模块驱动代码
 修改LSL文件,方便通过#pragma 来指定变量或者程序放在指定RAM,具体如何使用请参考库例程Specifies_Variable_Or_Code_Location_Demo
2020-04-27 17:41:10 +08:00

50 lines
1.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*********************************************************************************************************************
* COPYRIGHT NOTICE
* Copyright (c) 2020,逐飞科技
* All rights reserved.
* 技术讨论QQ群三群824575535
*
* 以下所有内容版权均属逐飞科技所有,未经允许不得用于商业用途,
* 欢迎各位使用并传播本程序,修改内容时必须保留逐飞科技的版权声明。
*
* @file main
* @company 成都逐飞科技有限公司
* @author 逐飞科技(QQ3184284598)
* @version 查看doc内version文件 版本说明
* @Software tasking v6.3r1
* @Target core TC264D
* @Taobao https://seekfree.taobao.com/
* @date 2020-3-23
********************************************************************************************************************/
#include "headfile.h"
#pragma section all "cpu0_dsram"
uint16 adc_result;
int core0_main(void)
{
disableInterrupts();
get_clk();//获取时钟频率 务必保留
//用户在此处调用各种初始化函数等
adc_init(ADC_0, ADC0_CH0_A0);//初始化ADC0 通道0 使用A0引脚
enableInterrupts();
while (TRUE)
{
//通过将A0引脚接到GND或者核心板VCC 查看FSS窗口中打印出来的ADC结果
//A0接到GND时 结果应该在0附近
//A0接到VCC时 结果应该在4095附近
//悬空时 结果可能是任意数,没有任何意义,所以大家不要问悬空的时候为什么结果是这么多呢?
adc_result = adc_mean_filter(ADC_0, ADC0_CH0_A0, ADC_12BIT, 10);//采集10次求平均 分辨率12位
printf("adc_result: %d\n", adc_result);
systick_delay_ms(STM0, 100);
}
}
#pragma section all restore