void RGBdriver::Send32Zero(void) { unsigned char i; for (i=0; i<32; i++) { digitalWrite(Datapin, LOW); ClkRise(); } }
void RGBdriver::Send32Zero(void) { unsigned char i; uint8_t volatile sreg; sreg = SREG; /* Save status register before disabling interrupts. */ cli(); /* Disable interrupts. */ for (i=0; i<32; i++) { digitalWrite(Datapin, LOW); ClkRise(); } SREG = sreg; /* Enable interrupts. */ }
// gray data void RGBdriver::DatSend(uint32_t dx) { uint8_t i; for (i=0; i<32; i++) { if ((dx & 0x80000000) != 0) { digitalWrite(Datapin, HIGH); } else { digitalWrite(Datapin, LOW); } dx <<= 1; ClkRise(); } }
// gray data void RGBdriver::DatSend(uint32_t dx) { uint8_t i; uint8_t volatile sreg; sreg = SREG; /* Save status register before disabling interrupts. */ cli(); /* Disable interrupts. */ for (i=0; i<32; i++) { if ((dx & 0x80000000) != 0) { digitalWrite(Datapin, HIGH); } else { digitalWrite(Datapin, LOW); } dx <<= 1; ClkRise(); } SREG = sreg; /* Enable interrupts. */ }