// Code to emulate Mitsubishi A/C IR remote control unit. // Inspired and derived from the work done at: // https://github.com/r45635/HVAC-IR-Control // // Warning: Consider this very alpha code. Seems to work, but not validated. // // Equipment it seems compatible with: // * <Add models (A/C & remotes) you've gotten it working with here> // Initialise the object. IRMitsubishiAC::IRMitsubishiAC(uint16_t pin) : _irsend(pin) { stateReset(); }
IRArgoAC::IRArgoAC(uint16_t pin) : _irsend(pin) { stateReset(); }
static void nextTile(doeE env, dcPathFiller pf) { dcPathFillerData* p = (dcPathFillerData*)pf; if (!stateCheck(p, setOutputAreaDone)) { doeError_set(env, dcPRError, dcPRError_UNEX_nextTile); return; } if (p->fastOutput) { stateReset(p, setOutputAreaDone); return; } /* advance x tile index */ p->tileXI++; if (p->tileXI > p->outWTi) { /* tileXI in [1, outWITi] */ /* clear left side effects */ LeftSide_releaseList(env, p->lsEffects); p->lsEffects = NULL; p->tileXI = 1; /* 0 is left-open tile */ p->tileYI++; if (p->tileYI >= p->outHTi) { stateReset(p, setOutputAreaDone); return; } p->rowH = p->outH - (p->tileYI << dcPathFiller_tileSizeL2S); if (p->rowH > dcPathFiller_tileSize) p->rowH = dcPathFiller_tileSize; p->rowHTiF = (f32)p->rowH / dcPathFiller_tileSizeF; } /* update left side effects */ { Run r; for (r = p->tileRuns[p->tileXI - 1][p->tileYI]; r != NULL; r = r->next) { f32 rspy0 = r->rspy0; f32 rspy1 = r->rspy1; LeftSide ls, lslink, tmp; /* no rightside projection? */ if (rspy1 == rspyImpossibleTss) { continue; } /* constrain [rsp] to the interval [0,rowHTiF] */ if (rspy0 < 0.0F) rspy0 = 0.0F; if (rspy1 < 0.0F) rspy1 = 0.0F; if (rspy0 > p->rowHTiF) rspy0 = p->rowHTiF; if (rspy1 > p->rowHTiF) rspy1 = p->rowHTiF; /* for each [ls] in [lsEffects] check whether [rsp] extends it; if so, modify [rsp] accordingly and remove [ls] from [lsEffects] */ ls = p->lsEffects; lslink = NULL; while (ls != NULL) { if (rspy1 == ls->y0 || rspy0 == ls->y1) { if (rspy1 == ls->y0) rspy1 = ls->y1; else rspy0 = ls->y0; if (lslink == NULL) p->lsEffects = ls->next; else lslink->next = ls->next; tmp = ls->next; ls->next = NULL; LeftSide_releaseList(env, ls); ls = tmp; } else { lslink = ls; ls = ls->next; } } /* if [rsp] still produces an effect, insert it in [lsEffect] */ if (rspy0 != rspy1) { ls = LeftSide_create(env, p->poolLeftSide); if (ls == NULL) return; ls->y0 = rspy0; ls->y1 = rspy1; ls->next = p->lsEffects; p->lsEffects = ls; } } } }