Skip to content

Commit 761d787

Browse files
committed
Use CIRCUITPY_OS_GETENV to guard new feature
1 parent 93f8076 commit 761d787

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/environment.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ Allows the entry of a display scaling factor used during the terminalio console
181181
The entered scaling factor only affects the terminalio console and has no impact on
182182
the UART, Web Workflow, BLE Workflow, etc consoles.
183183

184-
This feature is not enabled on some CircuitPython board with limited Flash, currently
185-
this includes some of the Atmel_samd boards based on the M0 microprocessor.
184+
This feature is not enabled on boards that the CIRCUITPY_OS_GETENV (os CIRCUIPTY_FULL_BUILD)
185+
flag has been set to 0. Currently this is primarily boards with limited flash including some
186+
of the Atmel_samd boards based on the SAMD21/M0 microprocessor.
186187

187188
`boards that the terminalio core module is available on <https://docs.circuitpython.org/en/latest/shared-bindings/terminalio/>`_

supervisor/shared/display.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636

3737
#if CIRCUITPY_TERMINALIO
3838
#include "supervisor/port.h"
39+
#if CIRCUITPY_OS_GETENV
3940
#include "shared-module/os/__init__.h"
4041
#endif
42+
#endif
4143

4244
#if CIRCUITPY_REPL_LOGO
4345
extern uint32_t blinka_bitmap_data[];
@@ -67,7 +69,9 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) {
6769
if (width_in_tiles <= 80) {
6870
scale = 1;
6971
}
72+
#if CIRCUITPY_OS_GETENV
7073
(void)common_hal_os_getenv_int("CIRCUITPY_TERMINAL_SCALE", &scale);
74+
#endif
7175

7276
width_in_tiles = MAX(1, width_px / (scroll_area->tile_width * scale));
7377
uint16_t height_in_tiles = MAX(2, height_px / (scroll_area->tile_height * scale));

0 commit comments

Comments
 (0)