Remove redundant shim annotations
This commit is contained in:
@ -127,7 +127,7 @@ namespace input {
|
||||
* @param name TODO
|
||||
* @param body TODO
|
||||
*/
|
||||
//% help=input/on-pin-pressed weight=83 shim=micro_bit::onPinPressed
|
||||
//% help=input/on-pin-pressed weight=83
|
||||
//% blockId=device_pin_event block="on pin|%NAME|pressed" icon="\uf094"
|
||||
void onPinPressed(TouchPin name, Action body) {
|
||||
auto pin = getPin((int)name);
|
||||
@ -142,7 +142,6 @@ namespace input {
|
||||
* Get the button state (pressed or not) for ``A`` and ``B``.
|
||||
*/
|
||||
//% help=input/button-is-pressed weight=57
|
||||
//% shim=micro_bit::isButtonPressed
|
||||
//% block="button|%NAME|is pressed"
|
||||
//% blockId=device_get_button2
|
||||
//% icon="\uf192" blockGap=8
|
||||
@ -162,7 +161,6 @@ namespace input {
|
||||
*/
|
||||
//% help=input/compass-heading
|
||||
//% weight=56 icon="\uf14e"
|
||||
//% shim=micro_bit::compassHeading
|
||||
//% blockId=device_heading block="compass heading (°)" blockGap=8
|
||||
int compassHeading() {
|
||||
return uBit.compass.heading();
|
||||
@ -173,7 +171,7 @@ namespace input {
|
||||
* Gets the temperature in Celsius degrees (°C).
|
||||
*/
|
||||
//% weight=55 icon="\uf06d"
|
||||
//% help=input/temperature shim=micro_bit::temperature
|
||||
//% help=input/temperature
|
||||
//% blockId=device_temperature block="temperature (°C)" blockGap=8
|
||||
int temperature() {
|
||||
return uBit.thermometer.getTemperature();
|
||||
@ -191,7 +189,6 @@ namespace input {
|
||||
* @param dimension TODO
|
||||
*/
|
||||
//% help=input/acceleration weight=54 icon="\uf135"
|
||||
//% shim=micro_bit::getAcceleration
|
||||
//% blockId=device_acceleration block="acceleration (mg)|%NAME" blockGap=8
|
||||
int acceleration(Dimension dimension) {
|
||||
switch (dimension) {
|
||||
@ -207,7 +204,7 @@ namespace input {
|
||||
/**
|
||||
* Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright. In the simulator, the ``acceleration y`` is used to emulate this value.
|
||||
*/
|
||||
//% help=input/light-level weight=53 shim=micro_bit::lightLevel
|
||||
//% help=input/light-level weight=53
|
||||
//% blockId=device_get_light_level block="light level" blockGap=8 icon="\uf185"
|
||||
int lightLevel() {
|
||||
return uBit.display.readLightLevel();
|
||||
@ -217,7 +214,7 @@ namespace input {
|
||||
* The pitch of the device, rotation along the ``x-axis``, in degrees.
|
||||
* @param kind TODO
|
||||
*/
|
||||
//% help=/input/rotation weight=52 shim=micro_bit::getRotation
|
||||
//% help=/input/rotation weight=52
|
||||
//% blockId=device_get_rotation block="rotation (°)|%NAME" blockGap=8 icon="\uf197"
|
||||
int rotation(Rotation kind) {
|
||||
switch (kind) {
|
||||
@ -231,7 +228,7 @@ namespace input {
|
||||
* Get the magnetic force value in ``micro-Teslas`` (``µT``). This function is not supported in the simulator.
|
||||
* @param dimension TODO
|
||||
*/
|
||||
//% help=input/magnetic-force weight=51 shim=micro_bit::getMagneticForce
|
||||
//% help=input/magnetic-force weight=51
|
||||
//% blockId=device_get_magnetic_force block="magnetic force (µT)|%NAME" blockGap=8 icon="\uf076"
|
||||
int magneticForce(Dimension dimension) {
|
||||
if (!uBit.compass.isCalibrated())
|
||||
@ -249,7 +246,7 @@ namespace input {
|
||||
/**
|
||||
* Gets the number of milliseconds elapsed since power on.
|
||||
*/
|
||||
//% help=input/running-time shim=micro_bit::getCurrentTime weight=50
|
||||
//% help=input/running-time weight=50
|
||||
//% blockId=device_get_running_time block="running time (ms)" icon="\uf017"
|
||||
int runningTime() {
|
||||
return uBit.systemTime();
|
||||
@ -258,14 +255,14 @@ namespace input {
|
||||
/**
|
||||
* Obsolete, compass calibration is automatic.
|
||||
*/
|
||||
//% help=input/calibrate weight=0 shim=TD_NOOP
|
||||
//% help=input/calibrate weight=0
|
||||
void calibrate() { }
|
||||
|
||||
/**
|
||||
* Get the pin state (pressed or not). Requires to hold the ground to close the circuit.
|
||||
* @param name pin used to detect the touch
|
||||
*/
|
||||
//% help=input/pin-is-pressed weight=58 shim=micro_bit::isPinTouched block="pin|%NAME|is pressed" icon="\uf094"
|
||||
//% help=input/pin-is-pressed weight=58 block="pin|%NAME|is pressed" icon="\uf094"
|
||||
bool pinIsPressed(TouchPin name) {
|
||||
auto pin = getPin((int)name);
|
||||
return pin && pin->isTouched();
|
||||
@ -278,7 +275,6 @@ namespace input {
|
||||
//% help=input/set-accelerator-range
|
||||
//% blockId=device_set_accelerometer_range block="set accelerometer|range %range" icon="\uf135"
|
||||
//% weight=5
|
||||
//% shim=micro_bit::setAccelerometerRange
|
||||
void setAccelerometerRange(AcceleratorRange range) {
|
||||
uBit.accelerometer.setRange((int)range);
|
||||
}
|
||||
|
Reference in New Issue
Block a user