V4updates (#185)
* update 32KB * reorder buttonEvents to have clicked as default * update event block documentation file path * remove on pin released documentation * update shims, enums and package-lock
This commit is contained in:
12
libs/core/enums.d.ts
vendored
12
libs/core/enums.d.ts
vendored
@ -41,17 +41,17 @@ declare namespace basic {
|
||||
|
||||
declare const enum ButtonEvent {
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="pressed down"
|
||||
Down = 1, // MICROBIT_BUTTON_EVT_DOWN
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="released up"
|
||||
Up = 2, // MICROBIT_BUTTON_EVT_UP
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="clicked"
|
||||
Click = 3, // MICROBIT_BUTTON_EVT_CLICK
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="long clicked"
|
||||
LongClick = 4, // MICROBIT_BUTTON_EVT_LONG_CLICK
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="pressed down"
|
||||
Down = 1, // MICROBIT_BUTTON_EVT_DOWN
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="released up"
|
||||
Up = 2, // MICROBIT_BUTTON_EVT_UP
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,18 +8,18 @@ enum class Button {
|
||||
};
|
||||
|
||||
enum class ButtonEvent {
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="pressed down"
|
||||
Down = MICROBIT_BUTTON_EVT_DOWN,
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="released up"
|
||||
Up = MICROBIT_BUTTON_EVT_UP,
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="clicked"
|
||||
Click = MICROBIT_BUTTON_EVT_CLICK,
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="long clicked"
|
||||
LongClick = MICROBIT_BUTTON_EVT_LONG_CLICK,
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="pressed down"
|
||||
Down = MICROBIT_BUTTON_EVT_DOWN,
|
||||
//% blockIdentity="input.buttonEventValueId"
|
||||
//% block="released up"
|
||||
Up = MICROBIT_BUTTON_EVT_UP,
|
||||
};
|
||||
|
||||
enum class Dimension {
|
||||
@ -187,7 +187,7 @@ namespace input {
|
||||
//% parts="buttonpair"
|
||||
//% group="Events"
|
||||
void onButtonEvent(Button button, int eventType, Action body) {
|
||||
registerWithDal((int)button, eventType, body);
|
||||
registerWithDal((int)button, (int)eventType, body);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,7 +230,7 @@ namespace input {
|
||||
* @param name the pin, eg: TouchPin.P0
|
||||
* @param body the code to run when event is fired on pin
|
||||
*/
|
||||
//% help=input/on-pin-touch weight=99 blockGap=16
|
||||
//% help=input/on-pin-event weight=99 blockGap=16
|
||||
//% blockId=device_pin_custom_event block="on pin %name| %eventType=control_button_event_value_id"
|
||||
//% group="Events"
|
||||
void onPinTouchEvent(TouchPin name, int eventType, Action body) {
|
||||
@ -239,7 +239,7 @@ namespace input {
|
||||
|
||||
// Forces the PIN to switch to makey-makey style detection.
|
||||
pin->isTouched();
|
||||
registerWithDal((int)name, eventType, body);
|
||||
registerWithDal((int)name, (int)eventType, body);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,7 +140,7 @@
|
||||
"microbit-dal": {
|
||||
"stack_size": 2048,
|
||||
"sram_end": "0x20008000",
|
||||
"RAM_SIZE": "\"16K\""
|
||||
"RAM_SIZE": "\"32K\""
|
||||
}
|
||||
}
|
||||
},
|
||||
|
2
libs/core/shims.d.ts
vendored
2
libs/core/shims.d.ts
vendored
@ -277,7 +277,7 @@ declare namespace input {
|
||||
* @param name the pin, eg: TouchPin.P0
|
||||
* @param body the code to run when event is fired on pin
|
||||
*/
|
||||
//% help=input/on-pin-touch weight=99 blockGap=16
|
||||
//% help=input/on-pin-event weight=99 blockGap=16
|
||||
//% blockId=device_pin_custom_event block="on pin %name| %eventType=control_button_event_value_id"
|
||||
//% group="Events" shim=input::onPinTouchEvent
|
||||
function onPinTouchEvent(name: TouchPin, eventType: int32, body: () => void): void;
|
||||
|
Reference in New Issue
Block a user