/** * Update the triacs at interrupt time, when GI dimming is in effect * DIM_BITS says which triac strings need to be turned on briefly * during this phase of the AC cycle. */ static __attribute__((noinline)) void triac_rtt_1 (U8 dim_bits) { static U8 triac_bits; /* Get the current triac states */ triac_bits = pinio_read_triac (); /* Turn on the lamps that need to be dimmed at this level. */ pinio_write_triac (triac_bits | dim_bits); /* Now disable the dimmed lamps for the next phase */ pinio_write_triac (triac_bits); }
void triac_update (void) { U8 latch; /* Refresh the triac latch by turning on all 'normal' * outputs, masked by anything allocated by a lamp effect. */ latch = triac_output; latch &= ~gi_leff_alloc; latch |= gi_leff_output; pinio_write_triac (latch); }