#define os_log(format, ...) custom_log("OTA", format, ##__VA_ARGS__) #include "TimeUtils.h" #include "mico.h" #include "main.h" #include "user_udp.h" #include "user_mqtt_client.h" #include "user_function.h" mico_timer_t power_timer; static uint32_t timer_count_last = 0; static uint32_t timer_count = 0; static uint32_t timer = 0; static void power_timer_handler( void* arg ) { // uint8_t pin_input = MicoGpioInputGet( POWER ); if ( timer_count_last != timer_count ) { // os_log("power_irq_handler:%u-%u=%u",timer_count,timer_count_last,timer); timer_count_last = timer_count; timer=timer/1000; power=9500000/timer; os_log("power_irq_handler:%u,%07u",power,timer); } // if(timer_count==0) os_log("power_timer_handler Hight:%d",timer_count_last); // timer_count++; // timer_count_last=timer_count; } static void power_irq_handler( void* arg ) { // timer_count_last=timer_count; timer_count = mico_nanosecond_clock_value(); timer=timer_count-timer_count_last; if(timer_count