Skip to content

Commit

Permalink
Merge pull request #106 from un-clouded/master
Browse files Browse the repository at this point in the history
Now builds on avr-gcc 5.4.0.
  • Loading branch information
cpldcpu authored Jul 19, 2024
2 parents 9119cc6 + b9c922e commit b300eda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion light_ws2812_AVR/Light_WS2812/light_ws2812.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void ws2812_sendarray(uint8_t *data,uint16_t datlen)

void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi)
{
// `maskhi` is 0x80 if P?7 is LED DATA
uint8_t curbyte,ctr,masklo;
uint8_t sreg_prev;
#if __AVR_ARCH__ != 100
Expand All @@ -132,18 +133,21 @@ void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi)

ws2812_DDRREG |= maskhi; // Enable output

// `masklo` and `maskhi` are written to PORT? to drive the DATA line low or
// high (rather than setting or clearing the bit in PORT?)
masklo =~maskhi&ws2812_PORTREG;
maskhi |= ws2812_PORTREG;

sreg_prev=SREG;

#ifdef interrupt_is_disabled
cli();
#endif

while (datlen--) {
curbyte=*data++;

asm volatile(
__asm__ volatile(
" ldi %0,8 \n\t"
#ifndef interrupt_is_disabled
" clt \n\t"
Expand Down

0 comments on commit b300eda

Please sign in to comment.