加入了max30102模块
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* APP_blood.c
|
||||
*
|
||||
* Created on: 2021年8月21日
|
||||
* Author: wuwenfeng
|
||||
*/
|
||||
|
||||
#include "APP_blood.h"
|
||||
|
||||
window *blood_win;
|
||||
|
||||
void APP_blood_init(window *a_window)
|
||||
{
|
||||
blood_win=a_window;
|
||||
}
|
||||
|
||||
void APP_blood_loop()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* APP_blood.h
|
||||
*
|
||||
* Created on: 2021Äê8ÔÂ21ÈÕ
|
||||
* Author: wuwenfeng
|
||||
*/
|
||||
|
||||
#ifndef APP_BLOOD_H_
|
||||
#define APP_BLOOD_H_
|
||||
#include "main.h"
|
||||
#include "windows.h"
|
||||
#include "LCD.h"
|
||||
|
||||
void APP_blood_init(window *a_window);
|
||||
void APP_blood_loop();
|
||||
|
||||
#endif /* APP_BLOOD_H_ */
|
||||
+14
-7
@@ -10,6 +10,9 @@
|
||||
#include "touch.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
|
||||
#include "APP_blood.h"
|
||||
|
||||
extern touch_device t0;
|
||||
|
||||
task run_loop;//Ö÷Ñ»·×´Ì¬»ú
|
||||
@@ -25,25 +28,29 @@ void main_app()
|
||||
|
||||
UI *ui=UI_Init(BLACK);
|
||||
|
||||
New_Window(ui,10,10,100,100,WHITE,"WHITE");
|
||||
New_Window(ui,25,30,150,100,GREEN,"GREEN");
|
||||
New_Window(ui,80,80,60,90,YELLOW,"YELLOW");
|
||||
New_Window(ui,120,90,70,60,MAGENTA,"MAGENTA");
|
||||
APP_blood_init(New_Window(ui,10,10,128,128,WHITE,"MAX30102"));
|
||||
|
||||
//New_Window(ui,25,30,150,100,GREEN,"GREEN");
|
||||
//New_Window(ui,80,80,60,90,YELLOW,"YELLOW");
|
||||
//New_Window(ui,120,90,70,60,MAGENTA,"MAGENTA");
|
||||
|
||||
ui->refresh_ui_flag=1;
|
||||
|
||||
while(1)
|
||||
{
|
||||
LCD_set_dot(t0.pix_x, t0.pix_y, RED);
|
||||
sprintf(str,"%04d\n%04d\n%04d",t0.pix_x,t0.pix_y,t0.c);
|
||||
LCD_ShowString(0, 0, &str, 16, RED, BLUE);
|
||||
//LCD_set_dot(t0.pix_x, t0.pix_y, RED);
|
||||
//sprintf(str,"%04d\n%04d\n%04d",t0.pix_x,t0.pix_y,t0.c);
|
||||
//LCD_ShowString(0, 0, &str, 16, RED, BLUE);
|
||||
/*
|
||||
switch(run_loop.sw)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
APP_blood_loop();
|
||||
|
||||
UI_Server(ui);
|
||||
TP_Server();
|
||||
EEPROM_SLOWWRITE_SERVER();
|
||||
|
||||
+38
-9
@@ -166,25 +166,53 @@ void Set_Windows_XY_BY_ACC(window *temp_window,int acc_x,int acc_y)
|
||||
}
|
||||
|
||||
//显示一个窗口
|
||||
void Refresh_Window(window *temp_window)
|
||||
void Refresh_Window(UI *ui,window *temp_window)
|
||||
{
|
||||
//开始绘制窗口//填充窗口背景
|
||||
int x,y;
|
||||
char z;
|
||||
for(uint16_t temp_y=0;temp_y<temp_window->high;temp_y++)
|
||||
{
|
||||
Inteface_SetCursor(temp_window->x,temp_window->y+temp_y);
|
||||
z=1;
|
||||
for(uint16_t temp_i=0;temp_i<temp_window->width;temp_i++)
|
||||
{
|
||||
if(temp_i==0||temp_y==0||temp_i==temp_window->width-1||temp_y==temp_window->high-1)
|
||||
x=temp_window->x+temp_i;
|
||||
y=temp_window->y+temp_y;
|
||||
if(y>=ui->y&&z==1)
|
||||
{
|
||||
Inteface_SetColor(BLUE);
|
||||
}else
|
||||
{
|
||||
Inteface_SetColor(temp_window->background);
|
||||
Inteface_SetCursor(x,y);
|
||||
z=0;
|
||||
}
|
||||
if(x>=ui->x)
|
||||
{
|
||||
if(temp_y<16)
|
||||
{
|
||||
if(temp_i>temp_window->width-16)
|
||||
{
|
||||
Inteface_SetColor(RED);
|
||||
}else
|
||||
{
|
||||
Inteface_SetColor(BLUE);
|
||||
}
|
||||
}else
|
||||
{
|
||||
if(temp_i==0||temp_y==0||temp_i==temp_window->width-1||temp_y==temp_window->high-1)
|
||||
{
|
||||
Inteface_SetColor(BLUE);
|
||||
}else
|
||||
{
|
||||
Inteface_SetColor(temp_window->background);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//绘制bar
|
||||
/*
|
||||
for(uint16_t temp_y=0;temp_y<16;temp_y++)
|
||||
{
|
||||
Inteface_SetCursor(temp_window->x,temp_window->y+temp_y);
|
||||
@@ -200,6 +228,7 @@ void Refresh_Window(window *temp_window)
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
//显示title
|
||||
LCD_ShowString(temp_window->x,temp_window->y,&temp_window->title,16,WHITE,WHITE);
|
||||
|
||||
@@ -230,7 +259,7 @@ void Refresh_UI(UI *ui)
|
||||
if(temp_windows_stack!=NULL)
|
||||
{
|
||||
flag=1;
|
||||
Refresh_Window(temp_windows_stack->window);
|
||||
Refresh_Window(ui,temp_windows_stack->window);
|
||||
//绘制下一个窗口
|
||||
temp_windows_stack=temp_windows_stack->next;
|
||||
}else
|
||||
@@ -363,7 +392,7 @@ void UI_Server(UI *ui)
|
||||
switch(hit_flag)
|
||||
{
|
||||
case CLOSE:
|
||||
Close_Windows_Stack(ui,temp_windows_stack);
|
||||
//Close_Windows_Stack(ui,temp_windows_stack);
|
||||
ui->refresh_ui_flag=1; //发生了变化 刷新ui的显示
|
||||
break;
|
||||
case BAR:
|
||||
|
||||
Reference in New Issue
Block a user