Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hub75: fix data buffering #722

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

ehime-iyokan
Copy link

I fixed buffering of red data. ( #691 (comment) )

The red data seems to be misaligned, so the display position is incorrect;
however, the other colors are fine.

// Sample code for order of operations
package main

import "fmt"

func main() {
	bitSelect := 2
	data_1 := 0x05
	data_2 := 0x05

	fmt.Println("before")
	fmt.Printf("%08b\n", data_1)
	data_1 = data_1 &^ 1 << bitSelect
	fmt.Printf("%08b\n", data_1)

	fmt.Println("after")
	fmt.Printf("%08b\n", data_2)
	data_2 &^= 1 << bitSelect
	fmt.Printf("%08b\n", data_2)
}
// before: it setting bits to 1 in unintended positions.
// after: it is clearing the bits in the intended positions.
$ go run .    
before
00000101
00010000
after
00000101
00000001

@ehime-iyokan
Copy link
Author

I have confirmed sample-program works without any problems. ehime-iyokan/DisplayWeatherInfoOnLEDmatrix@4ec0054

ledmatrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant