From 1eec65989421133b24b38604664dba322f7eee40 Mon Sep 17 00:00:00 2001 From: Chase Mortensen Date: Fri, 7 Jun 2019 15:54:58 -0700 Subject: [PATCH] Fix Black and White Typo (#2138) * Fixed typo: Back->Black * Added Upgrade Rules to fix spelling * Removed extra isEmpty * Added previous BackAndWhite to allow for compilation of old scripts --- docs/reference/led.md | 2 +- docs/reference/led/set-display-mode.md | 2 +- libs/core/_locales/core-strings.json | 2 +- libs/core/enums.d.ts | 2 ++ libs/core/led.cpp | 2 ++ pxtarget.json | 8 ++++++++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/reference/led.md b/docs/reference/led.md index 62047417..105b865b 100644 --- a/docs/reference/led.md +++ b/docs/reference/led.md @@ -12,7 +12,7 @@ led.plotBrightness(0, 0, 255) led.setBrightness(255); led.stopAnimation(); led.plotBarGraph(0, 0); -led.setDisplayMode(DisplayMode.BackAndWhite); +led.setDisplayMode(DisplayMode.BlackAndWhite); led.enable(false) ``` diff --git a/docs/reference/led/set-display-mode.md b/docs/reference/led/set-display-mode.md index b934e29f..06c83b4a 100644 --- a/docs/reference/led/set-display-mode.md +++ b/docs/reference/led/set-display-mode.md @@ -18,7 +18,7 @@ to have some amount of brightness to represent the grey value of real color. The Set the display mode to `black and white`. ```blocks -led.setDisplayMode(DisplayMode.BackAndWhite) +led.setDisplayMode(DisplayMode.BlackAndWhite) ``` ## See also diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 59d31f40..ee574669 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -69,7 +69,7 @@ "Dimension.Z|block": "z", "Direction.Left|block": "left", "Direction.Right|block": "right", - "DisplayMode.BackAndWhite|block": "black and white", + "DisplayMode.BlackAndWhite|block": "black and white", "DisplayMode.Greyscale|block": "greyscale", "EventCreationMode.CreateAndFire": "MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).", "EventCreationMode.CreateOnly": "MicroBitEvent is initialised, and no further processing takes place.", diff --git a/libs/core/enums.d.ts b/libs/core/enums.d.ts index 41c45fff..facf8f2d 100644 --- a/libs/core/enums.d.ts +++ b/libs/core/enums.d.ts @@ -416,6 +416,8 @@ declare namespace control { declare const enum DisplayMode { //% block="black and white" + BlackAndWhite = 0, // DISPLAY_MODE_BLACK_AND_WHITE + //% blockHidden=true BackAndWhite = 0, // DISPLAY_MODE_BLACK_AND_WHITE //% block="greyscale" Greyscale = 1, // DISPLAY_MODE_GREYSCALE diff --git a/libs/core/led.cpp b/libs/core/led.cpp index 5061ff31..80af46a9 100644 --- a/libs/core/led.cpp +++ b/libs/core/led.cpp @@ -2,6 +2,8 @@ enum class DisplayMode_ { //% block="black and white" + BlackAndWhite = DISPLAY_MODE_BLACK_AND_WHITE, + //% blockHidden=true BackAndWhite = DISPLAY_MODE_BLACK_AND_WHITE, //% block="greyscale" Greyscale = DISPLAY_MODE_GREYSCALE, diff --git a/pxtarget.json b/pxtarget.json index 2929ffd1..e24b4202 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -88,6 +88,14 @@ "device_print_message.message": "text" } } + ], + "0.0.0 - 1.4.12": [ + { + "type": "api", + "map": { + "DisplayMode\\s*\\.\\s*BackAndWhite": "DisplayMode.BlackAndWhite" + } + } ] }, "hidSelectors": [