Browse Source

cache

master
zhaohe 3 years ago
parent
commit
112c00592c
  1. 2
      APP/main.c
  2. 51
      APP/service/ozone_control_service.h
  3. 7
      APP/service/thisdevice.h

2
APP/main.c

@ -207,6 +207,7 @@ float get_ozone_power() {
} }
return powersum / 5; return powersum / 5;
} }
#if 0
typedef struct { typedef struct {
float LastP; // 0.02 float LastP; // 0.02
@ -245,7 +246,6 @@ float derivative(float now) {
return diff; return diff;
} }
#if 0
void printf_ozone_freq_and_power_table() { void printf_ozone_freq_and_power_table() {
/** /**
* @brief * @brief

51
APP/service/ozone_control_service.h

@ -0,0 +1,51 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "thisdevice.h"
typedef void (*ozone_onexception_cb_t)(error_t error);
typedef struct {
uint32_t minfreq; //
uint32_t maxfreq;
uint32_t stepfreq;
float level1_expect_power;
float level2_expect_power;
ozone_onexception_cb_t onexception;
} ozone_control_config_t;
void ozone_control_init(ozone_control_config_t *config);
void ozone_control_set_level(level_t level);
void ozone_control_start();
void ozone_control_stop();
float ozone_control_get_power();
void ozone_control_schedule();
/**
*
* 1
*
*
* :
* (+/2),
* (-/2),
*
*
* :
*
*
*
*
*
*
*
*
*
*/

7
APP/service/thisdevice.h

@ -19,6 +19,13 @@ typedef enum {
kchange_intermittentmode_time_input, kchange_intermittentmode_time_input,
} active_input_t; } active_input_t;
typedef enum {
knoneException,
kOzonePrimaryCircuitAnomaly, //,MOS断路,,MOS短路
kOzoneSecondaryCircuitAnomaly, //,穿
kfanIsBroken, //
} error_t;
typedef struct { typedef struct {
bool poweron; bool poweron;
mode_t mode; mode_t mode;

Loading…
Cancel
Save