Skip to content

Commit 80e8d07

Browse files
committed
🚸 [2.1.81] Mark MOTHERBOARD_ENV
1 parent 3155213 commit 80e8d07

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The following enhancements and changes have been made to ***Auto Build Marlin***.
44

5+
## 2.1.81
6+
- ABM Panel: Highlight user's `MOTHERBOARD_ENV`
7+
- ABM Panel / Edit View: Refactor CSS in sub-rules
8+
59
## 2.1.80
610
- Build: Fix 'reveal' for old Windows shell
711
- ABM Panel: Show hints on "USB" and Maple envs
@@ -24,8 +28,8 @@ The following enhancements and changes have been made to ***Auto Build Marlin***
2428
- Info Panel: Clean up appearance
2529

2630
## 2.1.75
27-
- Info Panel: Search marlinfw.org site for documentation.
28-
- Config Editor: Add parsing for Marlin `2.1.3-b3` macros.
31+
- Info Panel: Search marlinfw.org site for documentation
32+
- Config Editor: Add parsing for Marlin `2.1.3-b3` macros
2933

3034
## 2.1.74
3135
- Config Editor: Fix int and float value sanitizing

abm/abm.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ function allFilesAreLoaded() {
214214
const mb = marlin.configValue('MOTHERBOARD');
215215

216216
if (mb) {
217-
board_info = marlin.extractBoardInfo(mb);
217+
const mb_env = marlin.configValue('MOTHERBOARD_ENV'); // Users can add a preferred env for their board
218+
219+
board_info = marlin.extractBoardInfo(mb, mb_env);
220+
218221
log(`Board Info for ${mb} :`, board_info);
219222

220223
if (board_info.short)
@@ -236,6 +239,7 @@ function allFilesAreLoaded() {
236239
postValue('machine', '');
237240
postValue('machine-desc', '');
238241
postValue('board', mbn);
242+
postValue('board-env', '');
239243
postValue('board-desc', '');
240244
postValue('pins', '', '');
241245
postValue('pins-desc', '');
@@ -276,6 +280,8 @@ function allFilesAreLoaded() {
276280
postValue('board', mbn);
277281
postValue('board-desc', board_info.description);
278282

283+
if (board_info.board_env) postValue('board-env', board_info.board_env);
284+
279285
postValue('pins', board_info.pins_files);
280286
if (pindef_info.board_name) postValue('pins-desc', pindef_info.board_name);
281287

abm/css/abmview.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ body.vscode-dark, body.vscode-high-contrast {
2525
--abm-text-color-pale: #8A8;
2626
--abm-text-color-good: #6E6;
2727
--abm-text-color-limbo: #68E;
28+
--abm-text-color-limbo-prefer: #6A0;
2829
--abm-text-color-limbo-maple: #D6B;
2930
--abm-text-color-busy: #FA0;
3031
--abm-text-color-error: #C44;
@@ -48,6 +49,7 @@ body.vscode-light, body.vscode-high-contrast-light {
4849
--abm-text-color-pale: #45F;
4950
--abm-text-color-good: #00D000;
5051
--abm-text-color-limbo: #46C;
52+
--abm-text-color-limbo-prefer: #490;
5153
--abm-text-color-limbo-maple: #A08;
5254
--abm-text-color-busy: #A05900;
5355
--abm-text-color-error: #C00;
@@ -315,6 +317,8 @@ table#info>tbody>tr>td#info-envs { padding: 0; } /* Envs Cell */
315317

316318
/* Environment Name Colors */
317319
.env-name { color: var(--abm-text-color-limbo); }
320+
.prefer .env-name { color: var(--abm-text-color-limbo-prefer); }
321+
.prefer .env-name::after { content: " ⭐"; font-size: 0.5em; vertical-align: top; }
318322
.maple .env-name { color: var(--abm-text-color-limbo-maple); }
319323
.exists .env-name { color: var(--abm-text-color-good); }
320324

abm/js/abmview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ var ABM = (() => {
140140
// m.val = an array of env objects:
141141
// .name - Environment Name
142142
// .debug - Debug Allowed
143+
// .prefer - Preferred Env
143144
// .native - Native (Runnable)
144145
// .busy - Show "Please Wait..." State
145146
// .exists - The env build folder exists
@@ -167,6 +168,7 @@ var ABM = (() => {
167168
if (v.name.match(/.+maple.*/)) $erows.addClass('maple');
168169
if (v.debug) $erows.addClass('debug');
169170
if (v.native) $erows.addClass('native');
171+
if (v.prefer) $erows.addClass('prefer');
170172
if (v.busy) {
171173
$erows.addClass('busy');
172174
caption = 'Please Wait…';

abm/js/marlin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function extractTempSensors() {
217217
// Return hashed array { mb, pins_files, archs, archs_arr, envs, short, description, (has_debug), (error) }
218218
//
219219
var board_info;
220-
function extractBoardInfo(mb) {
220+
function extractBoardInfo(mb, mb_env) {
221221
let r, out = { has_debug: false }, sb = mb.replace('BOARD_', '');
222222

223223
// Get the include line matching the board
@@ -273,7 +273,7 @@ function extractBoardInfo(mb) {
273273
else if (/STM32F....C/i.test(name)) note = '(256K)';
274274

275275
const debugenv = /_debug$/i.test(name);
276-
out.envs.push({ name, note, debug: debugenv, native: type !== 'env' });
276+
out.envs.push({ name, note, debug: debugenv, native: type !== 'env', prefer: (mb_env == name) });
277277
if (debugenv) out.has_debug = true;
278278
}
279279

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "auto-build",
33
"displayName": "Auto Build Marlin",
44
"description": "Provides an interface to configure, build, and upload Marlin Firmware.",
5-
"version": "2.1.80",
5+
"version": "2.1.81",
66
"preview": false,
77
"publisher": "marlinfirmware",
88
"icon": "icon.png",

0 commit comments

Comments
 (0)