From bdb4068e803d93f234c021569fbd5e3d4d1b5020 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Fri, 31 May 2024 07:14:32 -0700 Subject: [PATCH] add a 300ms pause, only for N3 (#6381) * put a wait in * parameterized delay * update dal.d.ts --- libs/core---nrf52/dal.d.ts | 1 + libs/core---rp2040/dal.d.ts | 1 + libs/core---samd/dal.d.ts | 1 + libs/core---stm32/dal.d.ts | 1 + libs/core/dal.d.ts | 1 + libs/hw---n3/config.ts | 1 + libs/screen---st7735/targetoverrides.ts | 5 +++++ 7 files changed, 11 insertions(+) diff --git a/libs/core---nrf52/dal.d.ts b/libs/core---nrf52/dal.d.ts index 637e9c44cb4..716e20d62d6 100644 --- a/libs/core---nrf52/dal.d.ts +++ b/libs/core---nrf52/dal.d.ts @@ -680,6 +680,7 @@ declare const enum DAL { CFG_PIN_WIFI_AT_TX = 91, CFG_PIN_WIFI_AT_RX = 92, CFG_PIN_USB_POWER = 93, + CFG_DISPLAY_DELAY = 94, ACCELEROMETER_TYPE_LIS3DH = 50, ACCELEROMETER_TYPE_LIS3DH_ALT = 48, ACCELEROMETER_TYPE_MMA8453 = 56, diff --git a/libs/core---rp2040/dal.d.ts b/libs/core---rp2040/dal.d.ts index 42422212487..0c5ac9e71cf 100644 --- a/libs/core---rp2040/dal.d.ts +++ b/libs/core---rp2040/dal.d.ts @@ -762,6 +762,7 @@ declare const enum DAL { CFG_PIN_WIFI_AT_TX = 91, CFG_PIN_WIFI_AT_RX = 92, CFG_PIN_USB_POWER = 93, + CFG_DISPLAY_DELAY = 94, ACCELEROMETER_TYPE_LIS3DH = 50, ACCELEROMETER_TYPE_LIS3DH_ALT = 48, ACCELEROMETER_TYPE_MMA8453 = 56, diff --git a/libs/core---samd/dal.d.ts b/libs/core---samd/dal.d.ts index 1d8c89d83fe..19ab544f2a3 100644 --- a/libs/core---samd/dal.d.ts +++ b/libs/core---samd/dal.d.ts @@ -678,6 +678,7 @@ declare const enum DAL { CFG_PIN_WIFI_AT_TX = 91, CFG_PIN_WIFI_AT_RX = 92, CFG_PIN_USB_POWER = 93, + CFG_DISPLAY_DELAY = 94, ACCELEROMETER_TYPE_LIS3DH = 50, ACCELEROMETER_TYPE_LIS3DH_ALT = 48, ACCELEROMETER_TYPE_MMA8453 = 56, diff --git a/libs/core---stm32/dal.d.ts b/libs/core---stm32/dal.d.ts index 333b5bb36ce..5069e51316a 100644 --- a/libs/core---stm32/dal.d.ts +++ b/libs/core---stm32/dal.d.ts @@ -680,6 +680,7 @@ declare const enum DAL { CFG_PIN_WIFI_AT_TX = 91, CFG_PIN_WIFI_AT_RX = 92, CFG_PIN_USB_POWER = 93, + CFG_DISPLAY_DELAY = 94, ACCELEROMETER_TYPE_LIS3DH = 50, ACCELEROMETER_TYPE_LIS3DH_ALT = 48, ACCELEROMETER_TYPE_MMA8453 = 56, diff --git a/libs/core/dal.d.ts b/libs/core/dal.d.ts index 1d8c89d83fe..19ab544f2a3 100644 --- a/libs/core/dal.d.ts +++ b/libs/core/dal.d.ts @@ -678,6 +678,7 @@ declare const enum DAL { CFG_PIN_WIFI_AT_TX = 91, CFG_PIN_WIFI_AT_RX = 92, CFG_PIN_USB_POWER = 93, + CFG_DISPLAY_DELAY = 94, ACCELEROMETER_TYPE_LIS3DH = 50, ACCELEROMETER_TYPE_LIS3DH_ALT = 48, ACCELEROMETER_TYPE_MMA8453 = 56, diff --git a/libs/hw---n3/config.ts b/libs/hw---n3/config.ts index 4e9ae0cba34..79b40843bf1 100644 --- a/libs/hw---n3/config.ts +++ b/libs/hw---n3/config.ts @@ -27,6 +27,7 @@ namespace config { export const DISPLAY_WIDTH = 160 export const DISPLAY_HEIGHT = 128 + export const DISPLAY_DELAY = 300 export const DISPLAY_TYPE = 4242 // smart display diff --git a/libs/screen---st7735/targetoverrides.ts b/libs/screen---st7735/targetoverrides.ts index 88dd16d1565..134d4fe0ad4 100644 --- a/libs/screen---st7735/targetoverrides.ts +++ b/libs/screen---st7735/targetoverrides.ts @@ -5,6 +5,11 @@ //% groups=["0.","1#","2T","3t","4N","5n","6G","7g","8","9","aAR","bBP","cCp","dDO","eEY","fFW"] function img(lits: any, ...args: any[]): Image { return null } +// this wait needed in case of an ESD event for arcade shield +const delay = control.getConfigValue(DAL.CFG_DISPLAY_DELAY, 0) +if (delay > 0) + control.waitMicros(delay * 1000) + // set palette before creating screen, so the JS version has the right BPP image.setPalette(hex`__palette`) //% whenUsed