Skip to content

Commit 8b6e8c8

Browse files
committed
rename busy fields to isBusy
1 parent 1f37a13 commit 8b6e8c8

File tree

9 files changed

+56
-56
lines changed

9 files changed

+56
-56
lines changed

hd44780/hd44780.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (d *Device) SendCommand(command byte) {
210210
d.bus.SetCommandMode(true)
211211
d.bus.Write([]byte{command})
212212

213-
for d.busy(command == DISPLAY_CLEAR || command == CURSOR_HOME) {
213+
for d.isBusy(command == DISPLAY_CLEAR || command == CURSOR_HOME) {
214214
}
215215
}
216216

@@ -219,7 +219,7 @@ func (d *Device) sendData(data byte) {
219219
d.bus.SetCommandMode(false)
220220
d.bus.Write([]byte{data})
221221

222-
for d.busy(false) {
222+
for d.isBusy(false) {
223223
}
224224
}
225225

@@ -231,9 +231,9 @@ func (d *Device) CreateCharacter(cgramAddr uint8, data []byte) {
231231
}
232232
}
233233

234-
// busy returns true when hd447890 is busy
234+
// isBusy returns true when hd447890 is isBusy
235235
// or after the timeout specified
236-
func (d *Device) busy(longDelay bool) bool {
236+
func (d *Device) isBusy(longDelay bool) bool {
237237
if d.bus.WriteOnly() {
238238
// Can't read busy flag if write only, so sleep a bit then return
239239
if longDelay {
@@ -261,7 +261,7 @@ func (d *Device) busy(longDelay bool) bool {
261261

262262
// Busy returns true when hd447890 is busy
263263
func (d *Device) Busy() bool {
264-
return d.busy(false)
264+
return d.isBusy(false)
265265
}
266266

267267
// Size returns the current size of the display.

uc8151/uc8151.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Device struct {
3434
cs drivers.PinOutput
3535
dc drivers.PinOutput
3636
rst drivers.PinOutput
37-
busy drivers.PinInput
37+
isBusy drivers.PinInput
3838
width int16
3939
height int16
4040
buffer []uint8
@@ -55,11 +55,11 @@ func New(bus drivers.SPI, csPin, dcPin, rstPin legacy.PinOutput, busyPin legacy.
5555
legacy.ConfigurePinOut(rstPin)
5656
legacy.ConfigurePinInput(busyPin)
5757
return Device{
58-
bus: bus,
59-
cs: csPin.Set,
60-
dc: dcPin.Set,
61-
rst: rstPin.Set,
62-
busy: busyPin.Get,
58+
bus: bus,
59+
cs: csPin.Set,
60+
dc: dcPin.Set,
61+
rst: rstPin.Set,
62+
isBusy: busyPin.Get,
6363
}
6464
}
6565

@@ -313,14 +313,14 @@ func (d *Device) ClearDisplay() {
313313

314314
// WaitUntilIdle waits until the display is ready
315315
func (d *Device) WaitUntilIdle() {
316-
for !d.busy() {
316+
for !d.isBusy() {
317317
time.Sleep(10 * time.Millisecond)
318318
}
319319
}
320320

321321
// IsBusy returns the busy status of the display
322322
func (d *Device) IsBusy() bool {
323-
return d.busy()
323+
return d.isBusy()
324324
}
325325

326326
// ClearBuffer sets the buffer to 0xFF (white)

waveshare-epd/epd1in54/epd1in54.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type Device struct {
2929
cs drivers.PinOutput
3030
dc drivers.PinOutput
3131
rst drivers.PinOutput
32-
busy drivers.PinInput
32+
isBusy drivers.PinInput
3333
configurePins func()
3434
buffer []uint8
3535
rotation Rotation
@@ -89,7 +89,7 @@ func New(bus *machine.SPI, csPin, dcPin, rstPin legacy.PinOutput, busyPin legacy
8989
cs: csPin.Set,
9090
dc: dcPin.Set,
9191
rst: rstPin.Set,
92-
busy: busyPin.Get,
92+
isBusy: busyPin.Get,
9393
configurePins: func() {
9494
legacy.ConfigurePinOut(csPin)
9595
legacy.ConfigurePinOut(dcPin)
@@ -378,15 +378,15 @@ func (d *Device) Clear() {
378378

379379
// WaitUntilIdle waits until the display is ready
380380
func (d *Device) WaitUntilIdle() {
381-
for d.busy() {
381+
for d.isBusy() {
382382
time.Sleep(100 * time.Millisecond)
383383
}
384384
time.Sleep(200 * time.Millisecond)
385385
}
386386

387387
// IsBusy returns the busy status of the display
388388
func (d *Device) IsBusy() bool {
389-
return d.busy()
389+
return d.isBusy()
390390
}
391391

392392
// ClearBuffer sets the buffer to 0xFF (white)

waveshare-epd/epd2in13/epd2in13.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Device struct {
2424
cs drivers.PinOutput
2525
dc drivers.PinOutput
2626
rst drivers.PinOutput
27-
busy drivers.PinInput
27+
isBusy drivers.PinInput
2828
logicalWidth int16
2929
width int16
3030
height int16
@@ -59,11 +59,11 @@ func New(bus drivers.SPI, csPin, dcPin, rstPin legacy.PinOutput, busyPin legacy.
5959
legacy.ConfigurePinOut(rstPin)
6060
legacy.ConfigurePinInput(busyPin)
6161
return Device{
62-
bus: bus,
63-
cs: csPin.Set,
64-
dc: dcPin.Set,
65-
rst: rstPin.Set,
66-
busy: busyPin.Get,
62+
bus: bus,
63+
cs: csPin.Set,
64+
dc: dcPin.Set,
65+
rst: rstPin.Set,
66+
isBusy: busyPin.Get,
6767
}
6868
}
6969

@@ -298,14 +298,14 @@ func (d *Device) setMemoryPointer(x int16, y int16) {
298298

299299
// WaitUntilIdle waits until the display is ready
300300
func (d *Device) WaitUntilIdle() {
301-
for d.busy() {
301+
for d.isBusy() {
302302
time.Sleep(100 * time.Millisecond)
303303
}
304304
}
305305

306306
// IsBusy returns the busy status of the display
307307
func (d *Device) IsBusy() bool {
308-
return d.busy()
308+
return d.isBusy()
309309
}
310310

311311
// ClearBuffer sets the buffer to 0xFF (white)

waveshare-epd/epd2in13x/epd2in13x.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Device struct {
2323
cs drivers.PinOutput
2424
dc drivers.PinOutput
2525
rst drivers.PinOutput
26-
busy drivers.PinInput
26+
isBusy drivers.PinInput
2727
width int16
2828
height int16
2929
buffer [][]uint8
@@ -39,11 +39,11 @@ func New(bus drivers.SPI, csPin, dcPin, rstPin legacy.PinOutput, busyPin legacy.
3939
legacy.ConfigurePinOut(rstPin)
4040
legacy.ConfigurePinInput(busyPin)
4141
return Device{
42-
bus: bus,
43-
cs: csPin.Set,
44-
dc: dcPin.Set,
45-
rst: rstPin.Set,
46-
busy: busyPin.Get,
42+
bus: bus,
43+
cs: csPin.Set,
44+
dc: dcPin.Set,
45+
rst: rstPin.Set,
46+
isBusy: busyPin.Get,
4747
}
4848
}
4949

@@ -277,14 +277,14 @@ func (d *Device) ClearDisplay() {
277277

278278
// WaitUntilIdle waits until the display is ready
279279
func (d *Device) WaitUntilIdle() {
280-
for !d.busy() {
280+
for !d.isBusy() {
281281
time.Sleep(100 * time.Millisecond)
282282
}
283283
}
284284

285285
// IsBusy returns the busy status of the display
286286
func (d *Device) IsBusy() bool {
287-
return d.busy()
287+
return d.isBusy()
288288
}
289289

290290
// ClearBuffer sets the buffer to 0xFF (white)

waveshare-epd/epd2in66b/dev.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const (
1818
const Baudrate = 4_000_000 // 4 MHz
1919

2020
type Device struct {
21-
bus drivers.SPI
22-
cs drivers.PinOutput
23-
dc drivers.PinOutput
24-
rst drivers.PinOutput
25-
busy drivers.PinInput
21+
bus drivers.SPI
22+
cs drivers.PinOutput
23+
dc drivers.PinOutput
24+
rst drivers.PinOutput
25+
isBusy drivers.PinInput
2626

2727
blackBuffer []byte
2828
redBuffer []byte
@@ -206,7 +206,7 @@ func (d *Device) WaitUntilIdle() {
206206
// give it some time to get busy
207207
time.Sleep(50 * time.Millisecond)
208208

209-
for d.busy() { // high = busy
209+
for d.isBusy() { // high = busy
210210
time.Sleep(10 * time.Millisecond)
211211
}
212212

waveshare-epd/epd2in66b/dev_baremetal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ func (d *Device) Configure(c Config) error {
2525
d.cs = cs.Set
2626
d.dc = dc.Set
2727
d.rst = rst.Set
28-
d.busy = busy.Get
28+
d.isBusy = busy.Get
2929
return nil
3030
}

waveshare-epd/epd2in9/epd2in9.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Device struct {
3131
cs drivers.PinOutput
3232
dc drivers.PinOutput
3333
rst drivers.PinOutput
34-
busy drivers.PinInput
34+
isBusy drivers.PinInput
3535
logicalWidth int16
3636
width int16
3737
height int16
@@ -67,11 +67,11 @@ func New(bus drivers.SPI, csPin, dcPin, rstPin legacy.PinOutput, busyPin legacy.
6767
legacy.ConfigurePinOut(rstPin)
6868
legacy.ConfigurePinInput(busyPin)
6969
return Device{
70-
bus: bus,
71-
cs: csPin.Set,
72-
dc: dcPin.Set,
73-
rst: rstPin.Set,
74-
busy: busyPin.Get,
70+
bus: bus,
71+
cs: csPin.Set,
72+
dc: dcPin.Set,
73+
rst: rstPin.Set,
74+
isBusy: busyPin.Get,
7575
}
7676
}
7777

@@ -245,14 +245,14 @@ func (d *Device) setMemoryPointer(x int16, y int16) {
245245

246246
// WaitUntilIdle waits until the display is ready
247247
func (d *Device) WaitUntilIdle() {
248-
for d.busy() {
248+
for d.isBusy() {
249249
time.Sleep(100 * time.Millisecond)
250250
}
251251
}
252252

253253
// IsBusy returns the busy status of the display
254254
func (d *Device) IsBusy() bool {
255-
return d.busy()
255+
return d.isBusy()
256256
}
257257

258258
// ClearBuffer sets the buffer to 0xFF (white)

waveshare-epd/epd4in2/epd4in2.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Device struct {
2828
cs drivers.PinOutput
2929
dc drivers.PinOutput
3030
rst drivers.PinOutput
31-
busy drivers.PinInput
31+
isBusy drivers.PinInput
3232
logicalWidth int16
3333
width int16
3434
height int16
@@ -46,11 +46,11 @@ func New(bus drivers.SPI, csPin, dcPin, rstPin legacy.PinOutput, busyPin legacy.
4646
legacy.ConfigurePinOut(rstPin)
4747
legacy.ConfigurePinInput(busyPin)
4848
return Device{
49-
bus: bus,
50-
cs: csPin.Set,
51-
dc: dcPin.Set,
52-
rst: rstPin.Set,
53-
busy: busyPin.Get,
49+
bus: bus,
50+
cs: csPin.Set,
51+
dc: dcPin.Set,
52+
rst: rstPin.Set,
53+
isBusy: busyPin.Get,
5454
}
5555
}
5656

@@ -311,14 +311,14 @@ func (d *Device) ClearDisplay() {
311311

312312
// WaitUntilIdle waits until the display is ready
313313
func (d *Device) WaitUntilIdle() {
314-
for d.busy() {
314+
for d.isBusy() {
315315
time.Sleep(100 * time.Millisecond)
316316
}
317317
}
318318

319319
// IsBusy returns the busy status of the display
320320
func (d *Device) IsBusy() bool {
321-
return d.busy()
321+
return d.isBusy()
322322
}
323323

324324
// ClearBuffer sets the buffer to 0xFF (white)

0 commit comments

Comments
 (0)