Skip to content

Commit a0cfcee

Browse files
committed
Stub out the non-sequential parallel bus constructor
.. most boards can't support non-sequential pins, so share the implementation of the error routine so we get an identical message.
1 parent 4714861 commit a0cfcee

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

locale/circuitpython.pot

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ msgstr ""
586586
msgid "Buffer incorrect size. Should be %d bytes."
587587
msgstr ""
588588

589-
#: shared-bindings/displayio/Display.c
590589
#: shared-bindings/framebufferio/FramebufferDisplay.c
591590
msgid "Buffer is not a bytearray."
592591
msgstr ""
@@ -2194,6 +2193,12 @@ msgstr ""
21942193
msgid "The sample's signedness does not match the mixer's"
21952194
msgstr ""
21962195

2196+
#: shared-module/paralleldisplay/ParallelBus.c
2197+
msgid ""
2198+
"This microcontroller only supports data0=, not data_pins=, because it "
2199+
"requires contiguous pins."
2200+
msgstr ""
2201+
21972202
#: shared-bindings/displayio/TileGrid.c
21982203
msgid "Tile height must exactly divide bitmap height"
21992204
msgstr ""

py/circuitpy_defns.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ SRC_SHARED_MODULE_ALL = \
551551
onewireio/__init__.c \
552552
onewireio/OneWire.c \
553553
os/__init__.c \
554+
paralleldisplay/ParallelBus.c \
554555
qrio/__init__.c \
555556
qrio/QRDecoder.c \
556557
rainbowio/__init__.c \
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of the Micro Python project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "shared-bindings/paralleldisplay/ParallelBus.h"
28+
#include "py/runtime.h"
29+
30+
// If non-sequential pins aren't supported, then this default (weak)
31+
// implementation will raise an exception for you.
32+
__attribute__((weak))
33+
void common_hal_paralleldisplay_parallelbus_construct_nonsequential(paralleldisplay_parallelbus_obj_t *self,
34+
uint8_t n_pins, mcu_pin_obj_t **data_pins, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select,
35+
const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) {
36+
mp_raise_NotImplementedError(translate("This microcontroller only supports data0=, not data_pins=, because it requires contiguous pins."));
37+
}

0 commit comments

Comments
 (0)