关于头文件的main.c程序
#include "reg52.h"
#include "public.h"
#include "uart.h"
#include <stdio.h>
#include "greenhouse.h"
#include "ds18b20.h"
#include "motor.h"
u16 remain_led_running_time = 0;
u16 remain_fan_running_time = 0;
u8 read_temp_flag = 0;
void GH_RecValidData(u8 device,u8 HV,u8 LV)
{
u16 value =HV<<8 + LV;
switch (device)
{
case DEVICE_TEMP:
//printf("123456\r\n");
//UploadDeviceValue(DEVICE_TEMP,0x01,0x01);
read_temp_flag = 1;
break;
case DEVICE_FAN:
remain_fan_running_time = value;
break;
case DEVICE_LED:
remain_led_running_time = value;
break;
}
}
void GH_DataAssemblyComplete(u8 data_arr[],u8 len)
{
u8 i ;
for(i=0;i<len;i++)
{
uart_send_byte(data_arr[i]);
}
}
/
void main()
{
uart_init(BAUD_9600);
ds18b20_init();