Closed hughsaunders closed 4 years ago
Looks good to me. For posterity I'd probably have avoided conflating bitwise values and regular maths operators and been more explicit about what we want to happen by using now.day & 0b10000
instead of now.day > 0b1111
, but it's not a problem.
Thanks for spotting this and taking the time to PR a fix!
The date (day-of-month) field has 4 lights/bits so it can display values from 0-15, this isn't sufficient for dates which can go up to 31. This was recognised previously (#127) and colour was used to encode the 5th bit. However the previous solution was incorrect because it encodes the most significant bit in colour but discards the least significant bit with a right shift. This commit fixes that by only removing the most significant bit and encoding it as colour.