Skip to content

Commit

Permalink
add a 300ms pause, only for N3 (#6381)
Browse files Browse the repository at this point in the history
* put a wait in

* parameterized delay

* update dal.d.ts
  • Loading branch information
tballmsft authored and riknoll committed May 31, 2024
1 parent 409374a commit bdb4068
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions libs/core---nrf52/dal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libs/core---rp2040/dal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libs/core---samd/dal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libs/core---stm32/dal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libs/core/dal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libs/hw---n3/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions libs/screen---st7735/targetoverrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bdb4068

Please sign in to comment.