Skip to content

Commit e416ac0

Browse files
committed
pre-commit fixes
1 parent 0ce385b commit e416ac0

File tree

9 files changed

+98
-80
lines changed

9 files changed

+98
-80
lines changed

locale/circuitpython.pot

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ msgstr ""
153153
msgid "%q length must be >= %d"
154154
msgstr ""
155155

156-
#: py/objmodule.c py/runtime.c
156+
#: py/modsys.c py/objmodule.c py/runtime.c
157157
msgid "%q moved from %q to %q"
158158
msgstr ""
159159

@@ -1207,6 +1207,11 @@ msgstr ""
12071207
msgid "Invalid BSSID"
12081208
msgstr ""
12091209

1210+
#: shared-module/aurora_epaper/aurora_framebuffer.c
1211+
#, c-format
1212+
msgid "Invalid CoG id=%d"
1213+
msgstr ""
1214+
12101215
#: shared-bindings/wifi/Radio.c
12111216
msgid "Invalid MAC address"
12121217
msgstr ""
@@ -2154,6 +2159,14 @@ msgstr ""
21542159
msgid "Unknown BLE error: %d"
21552160
msgstr ""
21562161

2162+
#: shared-module/aurora_epaper/aurora_framebuffer.c
2163+
msgid "Unknown device size."
2164+
msgstr ""
2165+
2166+
#: shared-module/aurora_epaper/aurora_framebuffer.c
2167+
msgid "Unknown display type!"
2168+
msgstr ""
2169+
21572170
#: ports/espressif/common-hal/max3421e/Max3421E.c
21582171
#: ports/raspberrypi/common-hal/wifi/__init__.c
21592172
#, c-format
@@ -2211,6 +2224,10 @@ msgstr ""
22112224
msgid "Unsupported colorspace"
22122225
msgstr ""
22132226

2227+
#: shared-module/aurora_epaper/aurora_framebuffer.c
2228+
msgid "Unsupported device size."
2229+
msgstr ""
2230+
22142231
#: shared-module/displayio/bus_core.c
22152232
msgid "Unsupported display bus type"
22162233
msgstr ""
@@ -2329,6 +2346,7 @@ msgid "You pressed the SW38 button at start up."
23292346
msgstr ""
23302347

23312348
#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h
2349+
#: ports/espressif/boards/vidi_x/mpconfigboard.h
23322350
msgid "You pressed the VOLUME button at start up."
23332351
msgstr ""
23342352

shared-bindings/aurora_epaper/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ const mp_obj_module_t aurora_epaper_module = {
1717
.globals = (mp_obj_dict_t *)&aurora_epaper_globals,
1818
};
1919

20-
MP_REGISTER_MODULE(MP_QSTR_aurora_epaper, aurora_epaper_module);
20+
MP_REGISTER_MODULE(MP_QSTR_aurora_epaper, aurora_epaper_module);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#pragma once
1+
#pragma once

shared-bindings/aurora_epaper/aurora_framebuffer.c

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -29,52 +29,52 @@
2929
#include "shared-bindings/microcontroller/Pin.h"
3030
#include "shared-module/displayio/__init__.h"
3131

32-
// | class AuroraMemoryFramebuffer:
33-
// | """A framebuffer for Pervasive Displays Aurora E-paper displays. These displays are 2 color only.
34-
// |
35-
// | This initializes a display and connects it to CircuitPython.
36-
// |
37-
// | For Example::
38-
// |
39-
// | import busio
40-
// | import framebufferio
41-
// | from aurora_epaper import AuroraMemoryFramebuffer
42-
// | spi = busio.SPI(EINK_CLKS, EINK_MOSI, EINK_MISO)
43-
// | aurora = AuroraMemoryFramebuffer(spi, EINK_CS, EINK_RST, EINK_BUSY, EINK_DISCHARGE, HEIGHT, WIDTH)
44-
// | display = framebufferio.FramebufferDisplay(t, auto_refresh=False)
45-
// | display.refresh()
46-
// |
47-
// | For more information on how these displays are driven see:
48-
// | <https://www.pervasivedisplays.com/wp-content/uploads/2023/02/4P018-00_04_G2_Aurora-Mb_COG_Driver_Interface_Timing_for_small-size_20231107.pdf>
49-
// | """
50-
// |
51-
// | def __init__(
52-
// | self,
53-
// | spi_bus: busio.SPI,
54-
// | chip_select: microcontroller.Pin,
55-
// | reset: microcontroller.Pin,
56-
// | busy: microcontroller.Pin,
57-
// | discharge: microcontroller.Pin,
58-
// | width: int,
59-
// | height: int,
60-
// | power: Optional[microcontroller.Pin] = None,
61-
// | free_bus: Optional[bool] = True,
62-
// | ) -> None:
63-
// | """Create a framebuffer for the Aurora CoG display.
64-
// |
65-
// | .. note:: Displays of size 1.9" and 2.6" are not tested, and may exibit unexpected behavior.
66-
// |
67-
// | :param busio.SPI spi_bus: The SPI bus that the display is connected to
68-
// | :param microcontroller.Pin chip_select: The pin connected to the displays chip select input
69-
// | :param microcontroller.Pin reset: The pin connected to the displays reset input
70-
// | :param microcontroller.Pin busy: The pin connected to the displays busy output
71-
// | :param microcontroller.Pin discharge: The pin connected to the displays discharge input
72-
// | :param int width: The width of the display in pixels
73-
// | :param int height: The height of the display in pixels
74-
// | :param microcontroller.Pin power: The pin that controls power to the display (optional).
75-
// | :param bool free_bus: Determines whether the SPI bus passed in will be freed when the frame buffer is freed.
76-
// | """
77-
// |...
32+
//| class AuroraMemoryFramebuffer:
33+
//| """A framebuffer for Pervasive Displays Aurora E-paper displays. These displays are 2 color only.
34+
//|
35+
//| This initializes a display and connects it to CircuitPython.
36+
//|
37+
//| For Example::
38+
//|
39+
//| import busio
40+
//| import framebufferio
41+
//| from aurora_epaper import AuroraMemoryFramebuffer
42+
//| spi = busio.SPI(EINK_CLKS, EINK_MOSI, EINK_MISO)
43+
//| aurora = AuroraMemoryFramebuffer(spi, EINK_CS, EINK_RST, EINK_BUSY, EINK_DISCHARGE, HEIGHT, WIDTH)
44+
//| display = framebufferio.FramebufferDisplay(t, auto_refresh=False)
45+
//| display.refresh()
46+
//|
47+
//| For more information on how these displays are driven see:
48+
//| <https://www.pervasivedisplays.com/wp-content/uploads/2023/02/4P018-00_04_G2_Aurora-Mb_COG_Driver_Interface_Timing_for_small-size_20231107.pdf>
49+
//| """
50+
//|
51+
//| def __init__(
52+
//| self,
53+
//| spi_bus: busio.SPI,
54+
//| chip_select: microcontroller.Pin,
55+
//| reset: microcontroller.Pin,
56+
//| busy: microcontroller.Pin,
57+
//| discharge: microcontroller.Pin,
58+
//| width: int,
59+
//| height: int,
60+
//| power: Optional[microcontroller.Pin] = None,
61+
//| free_bus: Optional[bool] = True,
62+
//| ) -> None:
63+
//| """Create a framebuffer for the Aurora CoG display.
64+
//|
65+
//| .. note:: Displays of size 1.9" and 2.6" are not tested, and may exibit unexpected behavior.
66+
//|
67+
//| :param busio.SPI spi_bus: The SPI bus that the display is connected to
68+
//| :param microcontroller.Pin chip_select: The pin connected to the displays chip select input
69+
//| :param microcontroller.Pin reset: The pin connected to the displays reset input
70+
//| :param microcontroller.Pin busy: The pin connected to the displays busy output
71+
//| :param microcontroller.Pin discharge: The pin connected to the displays discharge input
72+
//| :param int width: The width of the display in pixels
73+
//| :param int height: The height of the display in pixels
74+
//| :param microcontroller.Pin power: The pin that controls power to the display (optional).
75+
//| :param bool free_bus: Determines whether the SPI bus passed in will be freed when the frame buffer is freed.
76+
//| """
77+
//|...
7878
static mp_obj_t aurora_epaper_framebuffer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
7979
enum { ARG_spi_bus, ARG_chip_select, ARG_reset, ARG_busy, ARG_discharge, ARG_width, ARG_height, ARG_power, ARG_free_bus, NUM_ARGS };
8080
static const mp_arg_t allowed_args[] = {
@@ -117,11 +117,11 @@ static mp_int_t aurora_epaper_framebuffer_get_buffer(mp_obj_t self_in, mp_buffer
117117
return 0;
118118
}
119119

120-
// | def deinit(self) -> None:
121-
// | """Free the resources (pins, timers, etc.) associated with this
122-
// | AuroraMemoryFramebuffer instance. After deinitialization, no further operations
123-
// | may be performed."""
124-
// | ...
120+
//| def deinit(self) -> None:
121+
//| """Free the resources (pins, timers, etc.) associated with this
122+
//| AuroraMemoryFramebuffer instance. After deinitialization, no further operations
123+
//| may be performed."""
124+
//| ...
125125
static mp_obj_t aurora_epaper_framebuffer_deinit(mp_obj_t self_in) {
126126
aurora_epaper_framebuffer_obj_t *self = (aurora_epaper_framebuffer_obj_t *)self_in;
127127
common_hal_aurora_epaper_framebuffer_deinit(self);
@@ -130,13 +130,13 @@ static mp_obj_t aurora_epaper_framebuffer_deinit(mp_obj_t self_in) {
130130
}
131131
static MP_DEFINE_CONST_FUN_OBJ_1(aurora_epaper_framebuffer_deinit_obj, aurora_epaper_framebuffer_deinit);
132132

133-
// | def set_temperature(
134-
// | self, celsius: int
135-
// | ) -> None:
136-
// | """Set the ambient temperature (in celsius) for the display driver.
137-
// | Higher temperature means faster update speed.
138-
// | """
139-
// | ...
133+
//| def set_temperature(
134+
//| self, celsius: int
135+
//| ) -> None:
136+
//| """Set the ambient temperature (in celsius) for the display driver.
137+
//| Higher temperature means faster update speed.
138+
//| """
139+
//| ...
140140
static mp_obj_t aurora_epaper_frambuffer_set_temperature(mp_obj_t self_in, mp_obj_t temperature) {
141141
aurora_epaper_framebuffer_obj_t *self = (aurora_epaper_framebuffer_obj_t *)self_in;
142142

@@ -146,10 +146,10 @@ static mp_obj_t aurora_epaper_frambuffer_set_temperature(mp_obj_t self_in, mp_ob
146146
}
147147
static MP_DEFINE_CONST_FUN_OBJ_2(aurora_epaper_frambuffer_set_temperature_obj, aurora_epaper_frambuffer_set_temperature);
148148

149-
// | free_bus: bool
150-
// | """When True the spi bus passed into the device will be freed on deinit.
151-
// | If you have multiple displays this could be used to keep the other active on soft reset."""
152-
// | ...
149+
//| free_bus: bool
150+
//| """When True the spi bus passed into the device will be freed on deinit.
151+
//| If you have multiple displays this could be used to keep the other active on soft reset."""
152+
//| ...
153153
static mp_obj_t aurora_epaper_framebuffer_get_free_bus(mp_obj_t self_in) {
154154
aurora_epaper_framebuffer_obj_t *self = (aurora_epaper_framebuffer_obj_t *)self_in;
155155
return mp_obj_new_bool(self->free_bus);

shared-bindings/aurora_epaper/aurora_framebuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright 2023 Cisco Systems, Inc. and its affiliates
33
* Author: Wyrdsec
4-
*
4+
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in
77
* the Software without restriction, including without limitation the rights to
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
// No module functions
2+
// No module functions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
#pragma once
2+
#pragma once

shared-module/aurora_epaper/aurora_framebuffer.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ void common_hal_aurora_epaper_framebuffer_draw_line(aurora_epaper_framebuffer_ob
421421

422422
uint32_t evenMap =
423423
(whiteMap << 2 | whiteMap) << 0 |
424-
(whiteMap << 2 | blackMap) << 4 |
425-
(blackMap << 2 | whiteMap) << 16 |
426-
(blackMap << 2 | blackMap) << 20;
424+
(whiteMap << 2 | blackMap) << 4 |
425+
(blackMap << 2 | whiteMap) << 16 |
426+
(blackMap << 2 | blackMap) << 20;
427427

428428
int stride = common_hal_aurora_epaper_framebuffer_get_row_stride(self);
429429

@@ -449,9 +449,9 @@ void common_hal_aurora_epaper_framebuffer_draw_line(aurora_epaper_framebuffer_ob
449449

450450
uint32_t oddMap =
451451
(whiteMap << 2 | whiteMap) << 0 |
452-
(whiteMap << 2 | blackMap) << 16 |
453-
(blackMap << 2 | whiteMap) << 4 |
454-
(blackMap << 2 | blackMap) << 20;
452+
(whiteMap << 2 | blackMap) << 16 |
453+
(blackMap << 2 | whiteMap) << 4 |
454+
(blackMap << 2 | blackMap) << 20;
455455

456456
// Odd bytes
457457
for (int x = 0; x < stride; x++) {
@@ -467,7 +467,7 @@ void common_hal_aurora_epaper_framebuffer_draw_line(aurora_epaper_framebuffer_ob
467467
common_hal_busio_spi_write(self->bus, &border, 1);
468468
}
469469

470-
#undef DO_MAP
470+
#undef DO_MAP
471471
}
472472
// This code is untested
473473
else if (self->type == SMALL_1_9 || self->type == LARGE_2_6) {
@@ -478,9 +478,9 @@ void common_hal_aurora_epaper_framebuffer_draw_line(aurora_epaper_framebuffer_ob
478478

479479
uint32_t pixelMap =
480480
(whiteMap << 2 | whiteMap) << 0 |
481-
(whiteMap << 2 | blackMap) << 4 |
482-
(blackMap << 2 | whiteMap) << 8 |
483-
(blackMap << 2 | blackMap) << 12;
481+
(whiteMap << 2 | blackMap) << 4 |
482+
(blackMap << 2 | whiteMap) << 8 |
483+
(blackMap << 2 | blackMap) << 12;
484484

485485
int stride = common_hal_aurora_epaper_framebuffer_get_row_stride(self);
486486

@@ -522,7 +522,7 @@ void common_hal_aurora_epaper_framebuffer_draw_line(aurora_epaper_framebuffer_ob
522522

523523
common_hal_busio_spi_write(self->bus, &border, 1);
524524

525-
#undef DO_MAP
525+
#undef DO_MAP
526526
} else {
527527
mp_raise_TypeError(MP_ERROR_TEXT("Unknown device size."));
528528
}

shared-module/displayio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void reset_displays(void) {
306306
common_hal_aurora_epaper_framebuffer_set_free_bus(false);
307307
}
308308
#endif
309-
// Set to None, gets deinit'd up by display_base
309+
// Set to None, gets deinit'd up by display_base
310310
display_buses[i].bus_base.type = &mp_type_NoneType;
311311
#endif
312312
} else {

0 commit comments

Comments
 (0)