新建app_temperature.c文件 规范代码结构
This commit is contained in:
parent
720fa461be
commit
ccb804412d
@ -14,7 +14,7 @@
|
|||||||
#include "app_charge.h"
|
#include "app_charge.h"
|
||||||
#include "app_power_manage.h"
|
#include "app_power_manage.h"
|
||||||
#include "asm/charge.h"
|
#include "asm/charge.h"
|
||||||
|
#include "app_temperature.h"
|
||||||
|
|
||||||
#if TCFG_KWS_VOICE_RECOGNITION_ENABLE
|
#if TCFG_KWS_VOICE_RECOGNITION_ENABLE
|
||||||
#include "jl_kws/jl_kws_api.h"
|
#include "jl_kws/jl_kws_api.h"
|
||||||
@ -117,578 +117,6 @@ void check_power_on_key(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 定义常量
|
|
||||||
#define R_FIXED 4700.0 // 固定电阻值4.7kΩ
|
|
||||||
#define B_CONST 4537.0 // NTC的B常数
|
|
||||||
#define T0 473.15 // 200℃转换为开尔文
|
|
||||||
#define R0 1000.0 // NTC在200℃时的电阻值1kΩ
|
|
||||||
|
|
||||||
/*
|
|
||||||
函数功能:计算温度的值
|
|
||||||
参数:无
|
|
||||||
返回值:无
|
|
||||||
备注:无
|
|
||||||
*/
|
|
||||||
float calculate_temperature(float voltage)
|
|
||||||
{
|
|
||||||
float R_ntc;
|
|
||||||
float V_supply = 3.0; // 电源电压5.0V
|
|
||||||
float tmp1 = 0.0;
|
|
||||||
float tmp2 = 0.0;
|
|
||||||
printf("voltage = %.2f\n", voltage);
|
|
||||||
// 计算NTC电阻值
|
|
||||||
R_ntc = R_FIXED * (V_supply / voltage - 1); //voltage是ADC值换算过来的电压
|
|
||||||
printf("R_ntc = %.2f\n", R_ntc);
|
|
||||||
// 计算温度(开尔文)
|
|
||||||
tmp1 = R_ntc/R0;
|
|
||||||
tmp2 = log(tmp1);
|
|
||||||
tmp1 = tmp2/B_CONST;
|
|
||||||
tmp2 = 1/T0;
|
|
||||||
tmp1 = (tmp1+tmp2);
|
|
||||||
tmp2 = 1.0/tmp1;
|
|
||||||
if(tmp2 <= 274)tmp2 = 274;
|
|
||||||
|
|
||||||
// 转换为摄氏度
|
|
||||||
tmp2 -= 273.15;
|
|
||||||
//tmp1 = tmp2+0.05; //温度补偿
|
|
||||||
|
|
||||||
//返回温度
|
|
||||||
return tmp2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//#include <math.h>
|
|
||||||
//#include <string.h>
|
|
||||||
//#include <stdio.h>
|
|
||||||
#define PAD_RIGHT 1
|
|
||||||
#define PAD_ZERO 2
|
|
||||||
#define SIGN 4 // Unsigned/signed long
|
|
||||||
#define SPACE 8 // Space if plus
|
|
||||||
#define LEFT 16 // Left justified
|
|
||||||
#define SPECIAL 32 // 0x
|
|
||||||
#define LARGE 64 // Use 'ABCDEF' instead of 'abcdef'
|
|
||||||
#define PLUS 128 // Show plus
|
|
||||||
#define CVTBUFSIZE 128
|
|
||||||
static char *flt(char **str, double num, int size, int precision, char fmt, int flags);
|
|
||||||
static char *ecvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf);
|
|
||||||
static char *fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf);
|
|
||||||
void put_float(double fv)
|
|
||||||
{
|
|
||||||
if (__builtin_isnan(fv)) {
|
|
||||||
puts("nan");
|
|
||||||
} else if (__builtin_isinf(fv)) {
|
|
||||||
puts("inf");
|
|
||||||
} else {
|
|
||||||
flt((void *)0, fv, 10, 3, 'f', ' ' | SIGN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
extern void putbyte(char a);
|
|
||||||
static void printchar(char **str, int c)
|
|
||||||
{
|
|
||||||
if (str) {
|
|
||||||
**str = c;
|
|
||||||
++(*str);
|
|
||||||
} else {
|
|
||||||
putbyte(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void cfltcvt(double value, char *buffer, char fmt, int precision)
|
|
||||||
{
|
|
||||||
int decpt, sign, exp, pos;
|
|
||||||
char *digits = (char *)0;
|
|
||||||
char cvtbuf[CVTBUFSIZE + 1];
|
|
||||||
int capexp = 0;
|
|
||||||
int magnitude;
|
|
||||||
if (fmt == 'G' || fmt == 'E') {
|
|
||||||
capexp = 1;
|
|
||||||
fmt += 'a' - 'A';
|
|
||||||
}
|
|
||||||
if (fmt == 'g') {
|
|
||||||
digits = ecvtbuf(value, precision, & decpt, & sign, cvtbuf);
|
|
||||||
magnitude = decpt - 1;
|
|
||||||
if (magnitude < - 4 || magnitude > precision - 1) {
|
|
||||||
fmt = 'e';
|
|
||||||
precision -= 1;
|
|
||||||
} else {
|
|
||||||
fmt = 'f';
|
|
||||||
precision -= decpt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (fmt == 'e') {
|
|
||||||
digits = ecvtbuf(value, precision + 1, & decpt, & sign, cvtbuf);
|
|
||||||
if (sign) {
|
|
||||||
* buffer ++ = '-';
|
|
||||||
}
|
|
||||||
* buffer ++ = * digits;
|
|
||||||
if (precision > 0) {
|
|
||||||
* buffer ++ = '.';
|
|
||||||
}
|
|
||||||
memcpy(buffer, digits + 1, precision);
|
|
||||||
buffer += precision;
|
|
||||||
* buffer ++ = capexp ? 'E' : 'e';
|
|
||||||
if (decpt == 0) {
|
|
||||||
if (value == 0.0) {
|
|
||||||
exp = 0;
|
|
||||||
} else {
|
|
||||||
exp = - 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
exp = decpt - 1;
|
|
||||||
}
|
|
||||||
if (exp < 0) {
|
|
||||||
* buffer ++ = '-';
|
|
||||||
exp = - exp;
|
|
||||||
} else {
|
|
||||||
* buffer ++ = '+';
|
|
||||||
}
|
|
||||||
buffer[2] = (exp % 10) + '0';
|
|
||||||
exp = exp / 10;
|
|
||||||
buffer[1] = (exp % 10) + '0';
|
|
||||||
exp = exp / 10;
|
|
||||||
buffer[0] = (exp % 10) + '0';
|
|
||||||
buffer += 3;
|
|
||||||
} else if (fmt == 'f') {
|
|
||||||
digits = fcvtbuf(value, precision, & decpt, & sign, cvtbuf);
|
|
||||||
if (sign) {
|
|
||||||
* buffer ++ = '-';
|
|
||||||
}
|
|
||||||
if (* digits) {
|
|
||||||
if (decpt <= 0) {
|
|
||||||
* buffer ++ = '0';
|
|
||||||
* buffer ++ = '.';
|
|
||||||
for (pos = 0; pos < - decpt; pos ++) {
|
|
||||||
* buffer ++ = '0';
|
|
||||||
}
|
|
||||||
while (* digits) {
|
|
||||||
* buffer ++ = * digits ++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
pos = 0;
|
|
||||||
while (* digits) {
|
|
||||||
if (pos ++ == decpt) {
|
|
||||||
* buffer ++ = '.';
|
|
||||||
}
|
|
||||||
* buffer ++ = * digits ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
* buffer ++ = '0';
|
|
||||||
if (precision > 0) {
|
|
||||||
* buffer ++ = '.';
|
|
||||||
for (pos = 0; pos < precision; pos ++) {
|
|
||||||
* buffer ++ = '0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
* buffer = '\0';
|
|
||||||
}
|
|
||||||
static void forcdecpt(char *buffer)
|
|
||||||
{
|
|
||||||
while (* buffer) {
|
|
||||||
if (* buffer == '.') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (* buffer == 'e' || * buffer == 'E') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
buffer ++;
|
|
||||||
}
|
|
||||||
if (* buffer) {
|
|
||||||
int n = strlen(buffer);
|
|
||||||
while (n > 0) {
|
|
||||||
buffer[n + 1] = buffer[n];
|
|
||||||
n --;
|
|
||||||
}
|
|
||||||
* buffer = '.';
|
|
||||||
} else {
|
|
||||||
* buffer ++ = '.';
|
|
||||||
* buffer = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void cropzeros(char *buffer)
|
|
||||||
{
|
|
||||||
char *stop;
|
|
||||||
while (* buffer && * buffer != '.') {
|
|
||||||
buffer ++;
|
|
||||||
}
|
|
||||||
if (* buffer ++) {
|
|
||||||
while (* buffer && * buffer != 'e' && * buffer != 'E') {
|
|
||||||
buffer ++;
|
|
||||||
}
|
|
||||||
stop = buffer --;
|
|
||||||
while (* buffer == '0') {
|
|
||||||
buffer --;
|
|
||||||
}
|
|
||||||
if (* buffer == '.') {
|
|
||||||
buffer --;
|
|
||||||
}
|
|
||||||
while ((*++ buffer = * stop ++));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static char *flt(char **str, double num, int size, int precision, char fmt, int flags)
|
|
||||||
{
|
|
||||||
char tmp[80];
|
|
||||||
char c, sign;
|
|
||||||
int n, i;
|
|
||||||
if (flags & LEFT) {
|
|
||||||
flags &= ~ PAD_ZERO;
|
|
||||||
}
|
|
||||||
// Determine padding and sign char
|
|
||||||
c = (flags & PAD_ZERO) ? '0' : ' ';
|
|
||||||
sign = 0;
|
|
||||||
if (flags & SIGN) {
|
|
||||||
if (num < 0.0) {
|
|
||||||
sign = '-';
|
|
||||||
num = - num;
|
|
||||||
size --;
|
|
||||||
} else if (flags & PLUS) {
|
|
||||||
sign = '+';
|
|
||||||
size --;
|
|
||||||
} else if (flags & SPACE) {
|
|
||||||
sign = ' ';
|
|
||||||
size --;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Compute the precision value
|
|
||||||
if (precision < 0) {
|
|
||||||
precision = 6; // Default precision: 6
|
|
||||||
} else if (precision == 0 && fmt == 'g') {
|
|
||||||
precision = 1; // ANSI specified
|
|
||||||
}
|
|
||||||
// Convert floating point number to text
|
|
||||||
cfltcvt(num, tmp, fmt, precision);
|
|
||||||
// '#' and precision == 0 means force a decimal point
|
|
||||||
if ((flags & SPECIAL) && precision == 0) {
|
|
||||||
forcdecpt(tmp);
|
|
||||||
}
|
|
||||||
// 'g' format means crop zero unless '#' given
|
|
||||||
if (fmt == 'g' && !(flags & SPECIAL)) {
|
|
||||||
cropzeros(tmp);
|
|
||||||
}
|
|
||||||
n = strlen(tmp);
|
|
||||||
// Output number with alignment and padding
|
|
||||||
size -= n;
|
|
||||||
if (!(flags & (PAD_ZERO | LEFT))) while (size -- > 0) {
|
|
||||||
printchar(str, ' '); //* str ++ = ' ';
|
|
||||||
}
|
|
||||||
if (sign) {
|
|
||||||
printchar(str, sign); //* str ++ = sign;
|
|
||||||
}
|
|
||||||
if (!(flags & LEFT)) while (size -- > 0) {
|
|
||||||
printchar(str, c); //* str ++ = c;
|
|
||||||
}
|
|
||||||
for (i = 0; i < n; i ++) {
|
|
||||||
printchar(str, tmp[i]); //* str ++ = tmp[i];
|
|
||||||
}
|
|
||||||
while (size -- > 0) {
|
|
||||||
printchar(str, ' '); //* str ++ = ' ';
|
|
||||||
}
|
|
||||||
return (char *)str;
|
|
||||||
}
|
|
||||||
static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
|
|
||||||
{
|
|
||||||
int r2;
|
|
||||||
double fi, fj;
|
|
||||||
char *p, * p1;
|
|
||||||
if (ndigits < 0) {
|
|
||||||
ndigits = 0;
|
|
||||||
}
|
|
||||||
if (ndigits >= CVTBUFSIZE - 1) {
|
|
||||||
ndigits = CVTBUFSIZE - 2;
|
|
||||||
}
|
|
||||||
r2 = 0;
|
|
||||||
* sign = 0;
|
|
||||||
p = & buf[0];
|
|
||||||
if (arg < 0) {
|
|
||||||
* sign = 1;
|
|
||||||
arg = - arg;
|
|
||||||
}
|
|
||||||
arg = modf(arg, & fi);
|
|
||||||
p1 = & buf[CVTBUFSIZE];
|
|
||||||
if (fi != 0) {
|
|
||||||
p1 = & buf[CVTBUFSIZE];
|
|
||||||
while (fi != 0) {
|
|
||||||
fj = modf(fi / 10, & fi);
|
|
||||||
*-- p1 = (int)((fj + .03) * 10) + '0';
|
|
||||||
r2 ++;
|
|
||||||
}
|
|
||||||
while (p1 < & buf[CVTBUFSIZE]) {
|
|
||||||
* p ++ = * p1 ++;
|
|
||||||
}
|
|
||||||
} else if (arg > 0) {
|
|
||||||
while ((fj = arg * 10) < 1) {
|
|
||||||
arg = fj;
|
|
||||||
r2 --;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p1 = & buf[ndigits];
|
|
||||||
if (eflag == 0) {
|
|
||||||
p1 += r2;
|
|
||||||
}
|
|
||||||
* decpt = r2;
|
|
||||||
if (p1 < & buf[0]) {
|
|
||||||
buf[0] = '\0';
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
while (p <= p1 && p < & buf[CVTBUFSIZE]) {
|
|
||||||
arg *= 10;
|
|
||||||
arg = modf(arg, & fj);
|
|
||||||
* p ++ = (int) fj + '0';
|
|
||||||
}
|
|
||||||
if (p1 >= & buf[CVTBUFSIZE]) {
|
|
||||||
buf[CVTBUFSIZE - 1] = '\0';
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
p = p1;
|
|
||||||
* p1 += 5;
|
|
||||||
while (* p1 > '9') {
|
|
||||||
* p1 = '0';
|
|
||||||
if (p1 > buf) {
|
|
||||||
++*-- p1;
|
|
||||||
} else {
|
|
||||||
* p1 = '1';
|
|
||||||
(* decpt)++;
|
|
||||||
if (eflag == 0) {
|
|
||||||
if (p > buf) {
|
|
||||||
* p = '0';
|
|
||||||
}
|
|
||||||
p ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
* p = '\0';
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
static char *ecvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
|
|
||||||
{
|
|
||||||
return cvt(arg, ndigits, decpt, sign, buf, 1);
|
|
||||||
}
|
|
||||||
static char *fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
|
|
||||||
{
|
|
||||||
return cvt(arg, ndigits, decpt, sign, buf, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//带返回值的,个人觉得这样更加方便,提高代码的简洁性
|
|
||||||
char *Float2String(float value)
|
|
||||||
{
|
|
||||||
char* str = (char*)malloc(10);
|
|
||||||
int Head = (int)value;
|
|
||||||
int Point = (int)((value - Head)*10.0);
|
|
||||||
sprintf(str, "%d.%d", Head, Point);
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int temp_detect(int adc1_vol){
|
|
||||||
printf("temp_detect\n");
|
|
||||||
printf("adc1_vol = %d\n", adc1_vol);
|
|
||||||
double R,R2=51000;
|
|
||||||
double temperature_ntc;
|
|
||||||
|
|
||||||
double temp = ((3000-adc1_vol)*1000 / adc1_vol);
|
|
||||||
printf("temp = %d\n", (int)temp);
|
|
||||||
|
|
||||||
R = (R2*1000 / temp);
|
|
||||||
|
|
||||||
printf("R = %d\n", (int)R);
|
|
||||||
printf("\n\n");
|
|
||||||
|
|
||||||
float a = 1.12f;
|
|
||||||
put_float(a);
|
|
||||||
printf("\n\n");
|
|
||||||
printf("+++ %d\n",(int)(a*1000));
|
|
||||||
|
|
||||||
//printf("float a --> %x\n", (uint32_t *)&a);
|
|
||||||
|
|
||||||
double aa = (60000 / 50000) *1000;
|
|
||||||
printf("aa1 = %d\n", aa);
|
|
||||||
|
|
||||||
float bb = 1.8f;
|
|
||||||
|
|
||||||
printf("aab = %s\n", Float2String(bb));
|
|
||||||
|
|
||||||
char str[32]={0};
|
|
||||||
sprintf(str,"%f",bb);
|
|
||||||
printf("str: %s",str);
|
|
||||||
|
|
||||||
printf("bb = %d\n", bb);
|
|
||||||
//printf("bb2 = %d\n", int(bb*1000.0f));
|
|
||||||
|
|
||||||
float test1 = (log(1.2f));
|
|
||||||
printf("test1 = %d\n", (int)(test1*1000.0f));
|
|
||||||
|
|
||||||
float temp3 = (log(60000.0f /50000.0f) );
|
|
||||||
printf("temp333 = %d\n", temp3*1000.0f);
|
|
||||||
|
|
||||||
|
|
||||||
int32_t temp2 = (log((int32_t)60000 / (int32_t)50000) );
|
|
||||||
printf("temp2 = %d\n", (int)temp2);
|
|
||||||
temperature_ntc = (1 / (temp2 + (1 / (double)298.15)) - (double)273.15)*100;
|
|
||||||
printf("Rtemperature_ntc = %d\n", (int)temperature_ntc);
|
|
||||||
return temperature_ntc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************** 宏定义 *********************************/
|
|
||||||
#define NTC_ADC_MAX 90+1
|
|
||||||
#define TEMPERA_START 3400
|
|
||||||
/**************** NTC热敏电阻转换成ADC的值 ***********************/
|
|
||||||
const uint16_t NTC_ADC_Tab[NTC_ADC_MAX]={
|
|
||||||
/*2559 ,2555 ,2551 ,2546 ,2542 ,2538 ,2534 ,2529 ,2525 ,2521 ,// 25.0~25.9 ℃
|
|
||||||
//2517 ,2513 ,2508 ,2504 ,2500 ,2496 ,2491 ,2487 ,2483 ,2479 ,// 26.0~26.9 ℃
|
|
||||||
2474 ,2470 ,2466 ,2461 ,2457 ,2453 ,2449 ,2444 ,2440 ,2436 ,// 27.0~27.9 ℃
|
|
||||||
2432 ,2427 ,2423 ,2419 ,2415 ,2410 ,2406 ,2402 ,2397 ,2393 ,// 28.0~28.9 ℃
|
|
||||||
2389 ,2385 ,2380 ,2376 ,2372 ,2368 ,2363 ,2359 ,2355 ,2350 ,// 29.0~29.9 ℃
|
|
||||||
2346 ,2342 ,2338 ,2333 ,2329 ,2325 ,2320 ,2316 ,2312 ,2308 ,// 30.0~30.9 ℃
|
|
||||||
2303 ,2299 ,2295 ,2291 ,2286 ,2282 ,2278 ,2273 ,2269 ,2265 ,// 31.0~31.9 ℃
|
|
||||||
2261 ,2256 ,2252 ,2248 ,2243 ,2239 ,2235 ,2231 ,2226 ,2222 ,// 32.0~32.9 ℃
|
|
||||||
2218 ,2214 ,2209 ,2205 ,2201 ,2196 ,2192 ,2188 ,2184 ,2179 ,// 33.0~33.9 ℃*/
|
|
||||||
|
|
||||||
//34.0
|
|
||||||
33806 ,33653 ,33500 ,33347 ,33194 ,33041 ,32888 ,32735 ,32582 ,32429,// 34.0~34.9 ℃
|
|
||||||
32436 ,32290 ,32144 ,31998 ,31852 ,31706 ,31560 ,31414 ,31268 ,31122,// 35.0~35.9 ℃
|
|
||||||
31127 ,30988 ,30849 ,30710 ,30571 ,30432 ,30293 ,30154 ,30015 ,29800,// 36.0~36.9 ℃
|
|
||||||
29876 ,29743 ,29610 ,29477 ,29344 ,29211 ,29078 ,28945 ,28812 ,28679,// 37.0~37.9 ℃
|
|
||||||
28680 ,28552 ,28424 ,28296 ,28168 ,28040 ,27912 ,27784 ,27656 ,27528,// 38.0~38.9 ℃
|
|
||||||
27535 ,27413 ,27291 ,27169 ,27047 ,26925 ,26803 ,26681 ,26559 ,26437,// 39.0~39.9 ℃
|
|
||||||
26441 ,26324 ,26207 ,26090 ,25973 ,25856 ,25739 ,25622 ,25505 ,25388,// 40.0~40.9 ℃
|
|
||||||
25394 ,25282 ,25170 ,25058 ,24946 ,24834 ,24722 ,24610 ,24498 ,24386,// 41.0~41.9 ℃
|
|
||||||
24393 ,24283 ,24173 ,24063 ,23953 ,23843 ,23733 ,23623 ,23513 ,23403 ,// 42.0~42.9 ℃
|
|
||||||
23300,
|
|
||||||
//43.0
|
|
||||||
/*
|
|
||||||
1801 ,1797 ,1793 ,1789 ,1785 ,1781 ,1777 ,1773 ,1769 ,1765 ,// 43.0~43.9 ℃
|
|
||||||
1761 ,1757 ,1753 ,1750 ,1746 ,1742 ,1738 ,1734 ,1730 ,1726 ,// 44.0~44.9 ℃
|
|
||||||
1722 ,// 45 ℃*/
|
|
||||||
};
|
|
||||||
|
|
||||||
void poka_adc_test(void)
|
|
||||||
{
|
|
||||||
printf("***************** adc test ***************\n\r");
|
|
||||||
//adc_init();
|
|
||||||
|
|
||||||
//u32 adc_io = IO_PORTB_06;
|
|
||||||
//gpio_set_die(adc_io, 0); //将io设为模拟功能
|
|
||||||
//浮空输入
|
|
||||||
//gpio_set_direction(adc_io, 1); //方向设为输入
|
|
||||||
//gpio_set_pull_up(adc_io, 0); //关上拉10K
|
|
||||||
//gpio_set_pull_down(adc_io, 0); //关下拉10K
|
|
||||||
|
|
||||||
|
|
||||||
u32 ch_ntc_adc = AD_CH_PB4;
|
|
||||||
u32 ch_ntc_power_adc = AD_CH_PB6;
|
|
||||||
|
|
||||||
|
|
||||||
extern void wdt_clr();
|
|
||||||
|
|
||||||
u16 ntc_adc_val = 0;
|
|
||||||
u16 ntc_adc_vol = 0;
|
|
||||||
//u16 ntc_adc_val = adc_get_value(ch_ntc_adc);
|
|
||||||
//u16 ntc_adc_vol = adc_get_voltage(ch_ntc_adc);
|
|
||||||
|
|
||||||
u16 ntc_power_adc_val = 0;
|
|
||||||
u16 ntc_power_adc_vol = 0;
|
|
||||||
//u16 ntc_power_adc_val = adc_get_value(ch_ntc_power_adc);
|
|
||||||
//u16 ntc_power_adc_vol = adc_get_voltage(ch_ntc_power_adc);
|
|
||||||
for(int i = 0 ;i < 10 ;i ++){
|
|
||||||
u16 ntc_adc_val_temp = adc_get_value(ch_ntc_adc);
|
|
||||||
ntc_adc_val = ntc_adc_val + ntc_adc_val_temp;
|
|
||||||
|
|
||||||
u16 ntc_adc_vol_temp = adc_get_voltage(ch_ntc_adc);
|
|
||||||
ntc_adc_vol = ntc_adc_vol + ntc_adc_vol_temp;
|
|
||||||
|
|
||||||
u16 ntc_power_adc_val_temp = adc_get_value(ch_ntc_power_adc);
|
|
||||||
ntc_power_adc_val = ntc_power_adc_val + ntc_power_adc_val_temp;
|
|
||||||
|
|
||||||
u16 ntc_power_adc_vol_temp = adc_get_voltage(ch_ntc_power_adc);
|
|
||||||
ntc_power_adc_vol = ntc_power_adc_vol + ntc_power_adc_vol_temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
ntc_adc_val = ntc_adc_val/10;
|
|
||||||
ntc_adc_vol = ntc_adc_vol/10;
|
|
||||||
|
|
||||||
ntc_power_adc_val = ntc_power_adc_val/10;
|
|
||||||
ntc_power_adc_vol = ntc_power_adc_vol/10;
|
|
||||||
|
|
||||||
//adc_get_value_by_isr(AD_CH_PB6, user_adc_cbfun);
|
|
||||||
|
|
||||||
//printf("vbg_val = %d\n", adc_get_voltage(AD_CH_LDOREF));
|
|
||||||
//printf("adc_val = %d\n", adc_val);
|
|
||||||
printf("ntc_adc = %d >>> %d mv\n", ntc_adc_val, ntc_adc_vol);
|
|
||||||
printf("ntc_power_adc = %d >>> %d mv\n", ntc_power_adc_val, ntc_power_adc_vol);
|
|
||||||
|
|
||||||
u32 i=(ntc_power_adc_vol-ntc_adc_vol)*100000/51000;//uA*100
|
|
||||||
printf("ntc I = %d \n", i );
|
|
||||||
//co_printf("i:%d\r\n",(uint16_t)i);
|
|
||||||
u32 R = ntc_adc_vol*1000*100/i;
|
|
||||||
printf("ntc R = %d \n", R );
|
|
||||||
|
|
||||||
|
|
||||||
u16 End = NTC_ADC_MAX - 1;// 数组下标最后一个数
|
|
||||||
u16 Front = 0;// 数组第一个数
|
|
||||||
u8 half = 0;
|
|
||||||
//u16 TempSingleADC = 0;// 单次转换的ADC值
|
|
||||||
u16 TempSingleValue = 0;// 单次换算成的温度值,用来函数返回值;
|
|
||||||
/**********二分法查表求温度值*********/
|
|
||||||
if ((R <= NTC_ADC_Tab[0]) && (R >= NTC_ADC_Tab[NTC_ADC_MAX - 1]))
|
|
||||||
{
|
|
||||||
for (half = 100; End - Front != 1;)
|
|
||||||
{
|
|
||||||
if (R > NTC_ADC_Tab[half])
|
|
||||||
{
|
|
||||||
End = half;
|
|
||||||
half = (End + Front) / 2;
|
|
||||||
}
|
|
||||||
else if (R < NTC_ADC_Tab[half])
|
|
||||||
{
|
|
||||||
Front = half;
|
|
||||||
half = (Front + End) / 2;
|
|
||||||
}
|
|
||||||
else // 正好等于表格中的值
|
|
||||||
{
|
|
||||||
TempSingleValue = TEMPERA_START + half * 10 + (NTC_ADC_Tab[half] - R) * 10 / (NTC_ADC_Tab[half] - NTC_ADC_Tab[half + 1]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (End - Front == 1) // 在表格两个值之间的数
|
|
||||||
{
|
|
||||||
TempSingleValue = TEMPERA_START + half * 10 + (NTC_ADC_Tab[half] - R) * 10 / (NTC_ADC_Tab[half] - NTC_ADC_Tab[half + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TempSingleValue = 0; // 温度超出数组范围,就返回0度
|
|
||||||
}
|
|
||||||
printf("T = %d \n", TempSingleValue );
|
|
||||||
// 输入参数
|
|
||||||
//float Vcc = 3.0; // 电源电压(单位:伏特)
|
|
||||||
//float R0B = 51000; // 固定电阻阻值(单位:欧姆)
|
|
||||||
//float V1 = io_vol/1000.0f; // 热敏电阻两端电压(单位:伏特)
|
|
||||||
|
|
||||||
// 计算热敏电阻的阻值
|
|
||||||
//float RR = calculateResistance(io_vol/1000.0f, _Vcc, R0B);
|
|
||||||
|
|
||||||
|
|
||||||
//float RR = R0 * (V1 / (Vcc - V1));
|
|
||||||
//printf("calculateResistance = %d ", RR );
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
while (1) {
|
|
||||||
wdt_clr();
|
|
||||||
delay(1000000);
|
|
||||||
_vbg_val = adc_get_value(AD_CH_LDOREF);
|
|
||||||
adc_val = adc_get_value(AD_CH_PB6);
|
|
||||||
io_vol = adc_get_voltage(AD_CH_PB6);
|
|
||||||
//adc_get_value_by_isr(AD_CH_PB6, user_adc_cbfun);
|
|
||||||
printf("adc_val = %d >>> %d mv\n", adc_val, io_vol*4);
|
|
||||||
printf("adc_val = %d\n", adc_val);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void enter_sleep(){
|
void enter_sleep(){
|
||||||
printf(">>>>>>>>>>>>>>>>>enter_sleep...\n");
|
printf(">>>>>>>>>>>>>>>>>enter_sleep...\n");
|
||||||
sys_s_hi_timer_del(enter_sleep);
|
sys_s_hi_timer_del(enter_sleep);
|
||||||
@ -713,19 +141,17 @@ void blink_led(){
|
|||||||
}
|
}
|
||||||
//int vbat = get_vbat_value();
|
//int vbat = get_vbat_value();
|
||||||
//printf(">>>>>>>>>>>>>>>>> vbat:%d\n",vbat);
|
//printf(">>>>>>>>>>>>>>>>> vbat:%d\n",vbat);
|
||||||
|
|
||||||
poka_adc_test();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void alarm_isr_user_cbfun(u8 index)
|
void alarm_isr_user_cbfun(u8 index)
|
||||||
{
|
{
|
||||||
printf("**** alarm %d : hello world ****\n", index);
|
printf("**** alarm %d : hello world ****\n", index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void user_main(){
|
void user_main(){
|
||||||
printf(">>>>>>>>>>>>>>>>>user_main...\n");
|
printf(">>>>>>>>>>>>>>>>>user_main...\n");
|
||||||
//NTC VDD
|
temperature_init();
|
||||||
gpio_direction_output(IO_PORTB_05, 1);
|
|
||||||
sys_s_hi_timer_add(NULL,blink_led,1000);
|
|
||||||
|
|
||||||
//sys_s_hi_timer_add(NULL,enter_sleep,5000);
|
//sys_s_hi_timer_add(NULL,enter_sleep,5000);
|
||||||
|
|
||||||
|
196
fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c
Normal file
196
fw-AC63_BT_SDK/apps/spp_and_le/app_temperature.c
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
#include "system/includes.h"
|
||||||
|
#include "app_config.h"
|
||||||
|
#include "app_action.h"
|
||||||
|
#include "app_main.h"
|
||||||
|
#include "update.h"
|
||||||
|
#include "update_loader_download.h"
|
||||||
|
#include "app_charge.h"
|
||||||
|
#include "app_power_manage.h"
|
||||||
|
#include "asm/charge.h"
|
||||||
|
#include "app_temperature.h"
|
||||||
|
|
||||||
|
static int led_state = 0;
|
||||||
|
|
||||||
|
|
||||||
|
void temperature_blink_led(){
|
||||||
|
if(led_state){
|
||||||
|
gpio_direction_output(IO_PORTA_07, 0);
|
||||||
|
led_state = 0;
|
||||||
|
}else{
|
||||||
|
led_state = 1;
|
||||||
|
gpio_direction_output(IO_PORTA_07, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************** 宏定义 *********************************/
|
||||||
|
#define NTC_ADC_MAX 90+1
|
||||||
|
#define TEMPERA_START 3400
|
||||||
|
/**************** NTC热敏电阻转换成ADC的值 ***********************/
|
||||||
|
const uint16_t NTC_ADC_Tab[NTC_ADC_MAX]={
|
||||||
|
/*2559 ,2555 ,2551 ,2546 ,2542 ,2538 ,2534 ,2529 ,2525 ,2521 ,// 25.0~25.9 ℃
|
||||||
|
//2517 ,2513 ,2508 ,2504 ,2500 ,2496 ,2491 ,2487 ,2483 ,2479 ,// 26.0~26.9 ℃
|
||||||
|
2474 ,2470 ,2466 ,2461 ,2457 ,2453 ,2449 ,2444 ,2440 ,2436 ,// 27.0~27.9 ℃
|
||||||
|
2432 ,2427 ,2423 ,2419 ,2415 ,2410 ,2406 ,2402 ,2397 ,2393 ,// 28.0~28.9 ℃
|
||||||
|
2389 ,2385 ,2380 ,2376 ,2372 ,2368 ,2363 ,2359 ,2355 ,2350 ,// 29.0~29.9 ℃
|
||||||
|
2346 ,2342 ,2338 ,2333 ,2329 ,2325 ,2320 ,2316 ,2312 ,2308 ,// 30.0~30.9 ℃
|
||||||
|
2303 ,2299 ,2295 ,2291 ,2286 ,2282 ,2278 ,2273 ,2269 ,2265 ,// 31.0~31.9 ℃
|
||||||
|
2261 ,2256 ,2252 ,2248 ,2243 ,2239 ,2235 ,2231 ,2226 ,2222 ,// 32.0~32.9 ℃
|
||||||
|
2218 ,2214 ,2209 ,2205 ,2201 ,2196 ,2192 ,2188 ,2184 ,2179 ,// 33.0~33.9 ℃*/
|
||||||
|
|
||||||
|
//34.0
|
||||||
|
33806 ,33653 ,33500 ,33347 ,33194 ,33041 ,32888 ,32735 ,32582 ,32429,// 34.0~34.9 ℃
|
||||||
|
32436 ,32290 ,32144 ,31998 ,31852 ,31706 ,31560 ,31414 ,31268 ,31122,// 35.0~35.9 ℃
|
||||||
|
31127 ,30988 ,30849 ,30710 ,30571 ,30432 ,30293 ,30154 ,30015 ,29800,// 36.0~36.9 ℃
|
||||||
|
29876 ,29743 ,29610 ,29477 ,29344 ,29211 ,29078 ,28945 ,28812 ,28679,// 37.0~37.9 ℃
|
||||||
|
28680 ,28552 ,28424 ,28296 ,28168 ,28040 ,27912 ,27784 ,27656 ,27528,// 38.0~38.9 ℃
|
||||||
|
27535 ,27413 ,27291 ,27169 ,27047 ,26925 ,26803 ,26681 ,26559 ,26437,// 39.0~39.9 ℃
|
||||||
|
26441 ,26324 ,26207 ,26090 ,25973 ,25856 ,25739 ,25622 ,25505 ,25388,// 40.0~40.9 ℃
|
||||||
|
25394 ,25282 ,25170 ,25058 ,24946 ,24834 ,24722 ,24610 ,24498 ,24386,// 41.0~41.9 ℃
|
||||||
|
24393 ,24283 ,24173 ,24063 ,23953 ,23843 ,23733 ,23623 ,23513 ,23403 ,// 42.0~42.9 ℃
|
||||||
|
23300,
|
||||||
|
//43.0
|
||||||
|
/*
|
||||||
|
1801 ,1797 ,1793 ,1789 ,1785 ,1781 ,1777 ,1773 ,1769 ,1765 ,// 43.0~43.9 ℃
|
||||||
|
1761 ,1757 ,1753 ,1750 ,1746 ,1742 ,1738 ,1734 ,1730 ,1726 ,// 44.0~44.9 ℃
|
||||||
|
1722 ,// 45 ℃*/
|
||||||
|
};
|
||||||
|
|
||||||
|
void temperature_detect(void)
|
||||||
|
{
|
||||||
|
printf("***************** adc test ***************\n\r");
|
||||||
|
//adc_init();
|
||||||
|
|
||||||
|
//u32 adc_io = IO_PORTB_06;
|
||||||
|
//gpio_set_die(adc_io, 0); //将io设为模拟功能
|
||||||
|
//浮空输入
|
||||||
|
//gpio_set_direction(adc_io, 1); //方向设为输入
|
||||||
|
//gpio_set_pull_up(adc_io, 0); //关上拉10K
|
||||||
|
//gpio_set_pull_down(adc_io, 0); //关下拉10K
|
||||||
|
|
||||||
|
|
||||||
|
u32 ch_ntc_adc = AD_CH_PB4;
|
||||||
|
u32 ch_ntc_power_adc = AD_CH_PB6;
|
||||||
|
|
||||||
|
|
||||||
|
extern void wdt_clr();
|
||||||
|
|
||||||
|
u16 ntc_adc_val = 0;
|
||||||
|
u16 ntc_adc_vol = 0;
|
||||||
|
//u16 ntc_adc_val = adc_get_value(ch_ntc_adc);
|
||||||
|
//u16 ntc_adc_vol = adc_get_voltage(ch_ntc_adc);
|
||||||
|
|
||||||
|
u16 ntc_power_adc_val = 0;
|
||||||
|
u16 ntc_power_adc_vol = 0;
|
||||||
|
//u16 ntc_power_adc_val = adc_get_value(ch_ntc_power_adc);
|
||||||
|
//u16 ntc_power_adc_vol = adc_get_voltage(ch_ntc_power_adc);
|
||||||
|
for(int i = 0 ;i < 10 ;i ++){
|
||||||
|
u16 ntc_adc_val_temp = adc_get_value(ch_ntc_adc);
|
||||||
|
ntc_adc_val = ntc_adc_val + ntc_adc_val_temp;
|
||||||
|
|
||||||
|
u16 ntc_adc_vol_temp = adc_get_voltage(ch_ntc_adc);
|
||||||
|
ntc_adc_vol = ntc_adc_vol + ntc_adc_vol_temp;
|
||||||
|
|
||||||
|
u16 ntc_power_adc_val_temp = adc_get_value(ch_ntc_power_adc);
|
||||||
|
ntc_power_adc_val = ntc_power_adc_val + ntc_power_adc_val_temp;
|
||||||
|
|
||||||
|
u16 ntc_power_adc_vol_temp = adc_get_voltage(ch_ntc_power_adc);
|
||||||
|
ntc_power_adc_vol = ntc_power_adc_vol + ntc_power_adc_vol_temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
ntc_adc_val = ntc_adc_val/10;
|
||||||
|
ntc_adc_vol = ntc_adc_vol/10;
|
||||||
|
|
||||||
|
ntc_power_adc_val = ntc_power_adc_val/10;
|
||||||
|
ntc_power_adc_vol = ntc_power_adc_vol/10;
|
||||||
|
|
||||||
|
//adc_get_value_by_isr(AD_CH_PB6, user_adc_cbfun);
|
||||||
|
|
||||||
|
//printf("vbg_val = %d\n", adc_get_voltage(AD_CH_LDOREF));
|
||||||
|
//printf("adc_val = %d\n", adc_val);
|
||||||
|
printf("ntc_adc = %d >>> %d mv\n", ntc_adc_val, ntc_adc_vol);
|
||||||
|
printf("ntc_power_adc = %d >>> %d mv\n", ntc_power_adc_val, ntc_power_adc_vol);
|
||||||
|
|
||||||
|
u32 i=(ntc_power_adc_vol-ntc_adc_vol)*100000/51000;//uA*100
|
||||||
|
printf("ntc I = %d \n", i );
|
||||||
|
//co_printf("i:%d\r\n",(uint16_t)i);
|
||||||
|
u32 R = ntc_adc_vol*1000*100/i;
|
||||||
|
printf("ntc R = %d \n", R );
|
||||||
|
|
||||||
|
|
||||||
|
u16 End = NTC_ADC_MAX - 1;// 数组下标最后一个数
|
||||||
|
u16 Front = 0;// 数组第一个数
|
||||||
|
u8 half = 0;
|
||||||
|
//u16 TempSingleADC = 0;// 单次转换的ADC值
|
||||||
|
u16 TempSingleValue = 0;// 单次换算成的温度值,用来函数返回值;
|
||||||
|
/**********二分法查表求温度值*********/
|
||||||
|
if ((R <= NTC_ADC_Tab[0]) && (R >= NTC_ADC_Tab[NTC_ADC_MAX - 1]))
|
||||||
|
{
|
||||||
|
for (half = 100; End - Front != 1;)
|
||||||
|
{
|
||||||
|
if (R > NTC_ADC_Tab[half])
|
||||||
|
{
|
||||||
|
End = half;
|
||||||
|
half = (End + Front) / 2;
|
||||||
|
}
|
||||||
|
else if (R < NTC_ADC_Tab[half])
|
||||||
|
{
|
||||||
|
Front = half;
|
||||||
|
half = (Front + End) / 2;
|
||||||
|
}
|
||||||
|
else // 正好等于表格中的值
|
||||||
|
{
|
||||||
|
TempSingleValue = TEMPERA_START + half * 10 + (NTC_ADC_Tab[half] - R) * 10 / (NTC_ADC_Tab[half] - NTC_ADC_Tab[half + 1]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (End - Front == 1) // 在表格两个值之间的数
|
||||||
|
{
|
||||||
|
TempSingleValue = TEMPERA_START + half * 10 + (NTC_ADC_Tab[half] - R) * 10 / (NTC_ADC_Tab[half] - NTC_ADC_Tab[half + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TempSingleValue = 0; // 温度超出数组范围,就返回0度
|
||||||
|
}
|
||||||
|
printf("T = %d \n", TempSingleValue );
|
||||||
|
// 输入参数
|
||||||
|
//float Vcc = 3.0; // 电源电压(单位:伏特)
|
||||||
|
//float R0B = 51000; // 固定电阻阻值(单位:欧姆)
|
||||||
|
//float V1 = io_vol/1000.0f; // 热敏电阻两端电压(单位:伏特)
|
||||||
|
|
||||||
|
// 计算热敏电阻的阻值
|
||||||
|
//float RR = calculateResistance(io_vol/1000.0f, _Vcc, R0B);
|
||||||
|
|
||||||
|
|
||||||
|
//float RR = R0 * (V1 / (Vcc - V1));
|
||||||
|
//printf("calculateResistance = %d ", RR );
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
while (1) {
|
||||||
|
wdt_clr();
|
||||||
|
delay(1000000);
|
||||||
|
_vbg_val = adc_get_value(AD_CH_LDOREF);
|
||||||
|
adc_val = adc_get_value(AD_CH_PB6);
|
||||||
|
io_vol = adc_get_voltage(AD_CH_PB6);
|
||||||
|
//adc_get_value_by_isr(AD_CH_PB6, user_adc_cbfun);
|
||||||
|
printf("adc_val = %d >>> %d mv\n", adc_val, io_vol*4);
|
||||||
|
printf("adc_val = %d\n", adc_val);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void temperature_init(void){
|
||||||
|
printf(">>>>>>>>>>>>>>>>> temperature_init ...\n");
|
||||||
|
//NTC VDD
|
||||||
|
gpio_direction_output(IO_PORTB_05, 1);
|
||||||
|
|
||||||
|
sys_s_hi_timer_add(NULL,temperature_blink_led,200);
|
||||||
|
sys_s_hi_timer_add(NULL,temperature_detect,1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void temperature_deinit(void){
|
||||||
|
printf(">>>>>>>>>>>>>>>>> temperature_deinit ...\n");
|
||||||
|
//NTC VDD
|
||||||
|
gpio_direction_output(IO_PORTB_05, 0);
|
||||||
|
}
|
@ -394,6 +394,7 @@
|
|||||||
<Unit filename="../../../../apps/common/update/uart_update_master.c"><Option compilerVer="CC"/></Unit>
|
<Unit filename="../../../../apps/common/update/uart_update_master.c"><Option compilerVer="CC"/></Unit>
|
||||||
<Unit filename="../../../../apps/common/update/update.c"><Option compilerVer="CC"/></Unit>
|
<Unit filename="../../../../apps/common/update/update.c"><Option compilerVer="CC"/></Unit>
|
||||||
<Unit filename="../../../../apps/spp_and_le/app_main.c"><Option compilerVer="CC"/></Unit>
|
<Unit filename="../../../../apps/spp_and_le/app_main.c"><Option compilerVer="CC"/></Unit>
|
||||||
|
<Unit filename="../../../../apps/spp_and_le/app_temperature.c"><Option compilerVer="CC"/></Unit>
|
||||||
<Unit filename="../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo.c"><Option compilerVer="CC"/></Unit>
|
<Unit filename="../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo.c"><Option compilerVer="CC"/></Unit>
|
||||||
<Unit filename="../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo_cfg.h" />
|
<Unit filename="../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo_cfg.h" />
|
||||||
<Unit filename="../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo_global_build_cfg.h" />
|
<Unit filename="../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo_global_build_cfg.h" />
|
||||||
@ -518,6 +519,7 @@
|
|||||||
<Unit filename="../../../../apps/spp_and_le/include/app_config.h" />
|
<Unit filename="../../../../apps/spp_and_le/include/app_config.h" />
|
||||||
<Unit filename="../../../../apps/spp_and_le/include/app_handshake.h" />
|
<Unit filename="../../../../apps/spp_and_le/include/app_handshake.h" />
|
||||||
<Unit filename="../../../../apps/spp_and_le/include/app_main.h" />
|
<Unit filename="../../../../apps/spp_and_le/include/app_main.h" />
|
||||||
|
<Unit filename="../../../../apps/spp_and_le/include/app_temperature.h" />
|
||||||
<Unit filename="../../../../apps/spp_and_le/include/app_power_manage.h" />
|
<Unit filename="../../../../apps/spp_and_le/include/app_power_manage.h" />
|
||||||
<Unit filename="../../../../apps/spp_and_le/include/app_task.h" />
|
<Unit filename="../../../../apps/spp_and_le/include/app_task.h" />
|
||||||
<Unit filename="../../../../apps/spp_and_le/include/at.h" />
|
<Unit filename="../../../../apps/spp_and_le/include/at.h" />
|
||||||
|
@ -334,6 +334,7 @@ c_SRC_FILES := \
|
|||||||
../../../../apps/common/update/uart_update_master.c \
|
../../../../apps/common/update/uart_update_master.c \
|
||||||
../../../../apps/common/update/update.c \
|
../../../../apps/common/update/update.c \
|
||||||
../../../../apps/spp_and_le/app_main.c \
|
../../../../apps/spp_and_le/app_main.c \
|
||||||
|
../../../../apps/spp_and_le/app_temperature.c \
|
||||||
../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo.c \
|
../../../../apps/spp_and_le/board/bd19/board_ac6321a_demo.c \
|
||||||
../../../../apps/spp_and_le/board/bd19/board_ac6323a_demo.c \
|
../../../../apps/spp_and_le/board/bd19/board_ac6323a_demo.c \
|
||||||
../../../../apps/spp_and_le/board/bd19/board_ac6323a_fmy.c \
|
../../../../apps/spp_and_le/board/bd19/board_ac6323a_fmy.c \
|
||||||
|
9
fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h
Normal file
9
fw-AC63_BT_SDK/apps/spp_and_le/include/app_temperature.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _APP_TEMPERATURE_H_
|
||||||
|
#define _APP_TEMPERATURE_H_
|
||||||
|
|
||||||
|
#include "typedef.h"
|
||||||
|
#include "system/event.h"
|
||||||
|
|
||||||
|
void temperature_init(void);
|
||||||
|
|
||||||
|
#endif //_APP_TEMPERATURE_H_
|
Loading…
x
Reference in New Issue
Block a user