libretiny

This commit is contained in:
Mit4el
2024-09-20 12:45:17 +03:00
parent b32abb5a28
commit 596eb9cad4
78 changed files with 8577 additions and 63 deletions

View File

@@ -138,12 +138,19 @@ public:
~BL0937wh(){};
};
#if defined LIBRETINY
void /* ICACHE_RAM_ATTR */ bl0937_cf1_interrupt()
#else
void ICACHE_RAM_ATTR bl0937_cf1_interrupt()
#endif
{
bl0937->cf1_interrupt();
}
#if defined LIBRETINY
void /* ICACHE_RAM_ATTR */ bl0937_cf_interrupt()
#else
void ICACHE_RAM_ATTR bl0937_cf_interrupt()
#endif
{
bl0937->cf_interrupt();
}

View File

@@ -177,16 +177,21 @@ void BL0937::setResistors(double current, double voltage_upstream, double voltag
_calculateDefaultMultipliers();
}
}
#if defined LIBRETINY
void /* ICACHE_RAM_ATTR */ BL0937::cf_interrupt() {
#else
void ICACHE_RAM_ATTR BL0937::cf_interrupt() {
#endif
unsigned long now = micros();
_power_pulse_width = now - _last_cf_interrupt;
_last_cf_interrupt = now;
_pulse_count++;
}
#if defined LIBRETINY
void /* ICACHE_RAM_ATTR */ BL0937::cf1_interrupt() {
#else
void ICACHE_RAM_ATTR BL0937::cf1_interrupt() {
#endif
unsigned long now = micros();
if ((now - _first_cf1_interrupt) > _pulse_timeout) {