ws2812: fix "invalid symbol redefinition" error

Named local labels shouldn't be used in LLVM because they might get
duplicated resulting in multiple symbol definitions and a compiler
error. Instead, use numeric labels.
This commit is contained in:
Ayke van Laethem
2019-08-10 20:59:55 +02:00
committed by Ron Evans
parent 7233452819
commit 514b436889
4 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -24,13 +24,13 @@ func (d Device) WriteByte(c byte) error {
// T1H: 8 cycles or 500.0ns -> together 19 cycles or 1187.5ns // T1H: 8 cycles or 500.0ns -> together 19 cycles or 1187.5ns
value := uint32(c) << 24 value := uint32(c) << 24
arm.AsmFull(` arm.AsmFull(`
send_bit: 1: @ send_bit
str {maskSet}, {portSet} @ [2] T0H and T0L start here str {maskSet}, {portSet} @ [2] T0H and T0L start here
nop @ [1] nop @ [1]
lsls {value}, #1 @ [1] lsls {value}, #1 @ [1]
bcs.n skip_store @ [1/3] bcs.n 2f @ [1/3] skip_store
str {maskClear}, {portClear} @ [2] T0H -> T0L transition str {maskClear}, {portClear} @ [2] T0H -> T0L transition
skip_store: 2: @ skip_store
nop @ [4] nop @ [4]
nop nop
nop nop
@@ -39,7 +39,7 @@ func (d Device) WriteByte(c byte) error {
nop @ [2] nop @ [2]
nop nop
subs {i}, #1 @ [1] subs {i}, #1 @ [1]
bne.n send_bit @ [1/3] bne.n 1b @ [1/3] send_bit
`, map[string]interface{}{ `, map[string]interface{}{
"value": value, "value": value,
"i": 8, "i": 8,
+4 -4
View File
@@ -23,7 +23,7 @@ func (d Device) WriteByte(c byte) error {
// T1L: 22 cycles or 458.3ns -> together 49 cycles or 1020.8ns // T1L: 22 cycles or 458.3ns -> together 49 cycles or 1020.8ns
value := uint32(c) << 24 value := uint32(c) << 24
arm.AsmFull(` arm.AsmFull(`
send_bit: 1: @ send_bit
str {maskSet}, {portSet} @ [2] T0H and T0L start here str {maskSet}, {portSet} @ [2] T0H and T0L start here
lsls {value}, #1 @ [1] lsls {value}, #1 @ [1]
nop @ [6] nop @ [6]
@@ -32,9 +32,9 @@ func (d Device) WriteByte(c byte) error {
nop nop
nop nop
nop nop
bcs.n skip_store @ [1/3] bcs.n 2f @ [1/3] skip_store
str {maskClear}, {portClear} @ [2] T0H -> T0L transition str {maskClear}, {portClear} @ [2] T0H -> T0L transition
skip_store: 2: @ skip_store
nop @ [15] nop @ [15]
nop nop
nop nop
@@ -68,7 +68,7 @@ func (d Device) WriteByte(c byte) error {
nop nop
nop nop
subs {i}, #1 @ [1] subs {i}, #1 @ [1]
bne.n send_bit @ [1/3] bne.n 1b @ [1/3] send_bit
`, map[string]interface{}{ `, map[string]interface{}{
"value": value, "value": value,
"i": 8, "i": 8,
+4 -4
View File
@@ -29,7 +29,7 @@ func (d Device) WriteByte(c byte) error {
// by ARM that state this are now considered superseded (by what?). // by ARM that state this are now considered superseded (by what?).
value := uint32(c) << 24 value := uint32(c) << 24
arm.AsmFull(` arm.AsmFull(`
send_bit: 1: @ send_bit
str {maskSet}, {portSet} @ [2] T0H and T0L start here str {maskSet}, {portSet} @ [2] T0H and T0L start here
lsls {value}, #1 @ [1] lsls {value}, #1 @ [1]
nop @ [28] nop @ [28]
@@ -60,9 +60,9 @@ func (d Device) WriteByte(c byte) error {
nop nop
nop nop
nop nop
bcs.n skip_store @ [1-3] bcs.n 2f @ [1-3] skip_store
str {maskClear}, {portClear} @ [2] T0H -> T0L transition str {maskClear}, {portClear} @ [2] T0H -> T0L transition
skip_store: 2: @ skip_store
nop @ [41] nop @ [41]
nop nop
nop nop
@@ -160,7 +160,7 @@ func (d Device) WriteByte(c byte) error {
nop nop
nop nop
subs {i}, #1 @ [1] subs {i}, #1 @ [1]
bne.n send_bit @ [1-3] bne.n 1b @ [1-3] send_bit
`, map[string]interface{}{ `, map[string]interface{}{
"value": value, "value": value,
"i": 8, "i": 8,
+4 -4
View File
@@ -28,7 +28,7 @@ func (d Device) WriteByte(c byte) error {
// by ARM that state this are now considered superseded (by what?). // by ARM that state this are now considered superseded (by what?).
value := uint32(c) << 24 value := uint32(c) << 24
arm.AsmFull(` arm.AsmFull(`
send_bit: 1: @ send_bit
str {maskSet}, {portSet} @ [2] T0H and T0L start here str {maskSet}, {portSet} @ [2] T0H and T0L start here
lsls {value}, #1 @ [1] lsls {value}, #1 @ [1]
nop @ [13] nop @ [13]
@@ -44,9 +44,9 @@ func (d Device) WriteByte(c byte) error {
nop nop
nop nop
nop nop
bcs.n skip_store @ [1-3] bcs.n 2f @ [1-3] skip_store
str {maskClear}, {portClear} @ [2] T0H -> T0L transition str {maskClear}, {portClear} @ [2] T0H -> T0L transition
skip_store: 2: @ skip_store
nop @ [22] nop @ [22]
nop nop
nop nop
@@ -97,7 +97,7 @@ func (d Device) WriteByte(c byte) error {
nop nop
nop nop
subs {i}, #1 @ [1] subs {i}, #1 @ [1]
bne.n send_bit @ [1-3] bne.n 1b @ [1-3] send_bit
`, map[string]interface{}{ `, map[string]interface{}{
"value": value, "value": value,
"i": 8, "i": 8,