Remove redundant shim annotations

This commit is contained in:
Michal Moskal 2016-04-01 21:27:22 -07:00
parent 650fe61dcd
commit 88acd9254d
2 changed files with 17 additions and 21 deletions

View File

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

View File

@ -73,7 +73,7 @@ namespace pins {
* Read the specified pin or connector as either 0 or 1 * Read the specified pin or connector as either 0 or 1
* @param name pin to read from * @param name pin to read from
*/ */
//% help=pins/digital-read-pin weight=30 shim=micro_bit::digitalReadPin //% help=pins/digital-read-pin weight=30
//% blockId=device_get_digital_pin block="digital read|pin %name" blockGap=8 //% blockId=device_get_digital_pin block="digital read|pin %name" blockGap=8
int digitalReadPin(DigitalPin name) { int digitalReadPin(DigitalPin name) {
PINREAD(getDigitalValue()); PINREAD(getDigitalValue());
@ -84,7 +84,7 @@ namespace pins {
* @param name pin to write to * @param name pin to write to
* @param value value to set on the pin, 1 eg,0 * @param value value to set on the pin, 1 eg,0
*/ */
//% help=pins/digital-write-pin weight=29 shim=micro_bit::digitalWritePin //% help=pins/digital-write-pin weight=29
//% blockId=device_set_digital_pin block="digital write|pin %name|to %value" //% blockId=device_set_digital_pin block="digital write|pin %name|to %value"
void digitalWritePin(DigitalPin name, int value) { void digitalWritePin(DigitalPin name, int value) {
PINOP(setDigitalValue(value)); PINOP(setDigitalValue(value));
@ -94,7 +94,7 @@ namespace pins {
* Read the connector value as analog, that is, as a value comprised between 0 and 1023. * Read the connector value as analog, that is, as a value comprised between 0 and 1023.
* @param name pin to write to * @param name pin to write to
*/ */
//% help=pins/analog-read-pin weight=25 shim=micro_bit::analogReadPin //% help=pins/analog-read-pin weight=25
//% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8" //% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8"
int analogReadPin(AnalogPin name) { int analogReadPin(AnalogPin name) {
PINREAD(getAnalogValue()); PINREAD(getAnalogValue());
@ -105,7 +105,7 @@ namespace pins {
* @param name pin name to write to * @param name pin name to write to
* @param value value to write to the pin between ``0`` and ``1023``. eg:1023,0 * @param value value to write to the pin between ``0`` and ``1023``. eg:1023,0
*/ */
//% help=pins/analog-write-pin weight=24 shim=micro_bit::analogWritePin //% help=pins/analog-write-pin weight=24
//% blockId=device_set_analog_pin block="analog write|pin %name|to %value" blockGap=8 //% blockId=device_set_analog_pin block="analog write|pin %name|to %value" blockGap=8
void analogWritePin(AnalogPin name, int value) { void analogWritePin(AnalogPin name, int value) {
PINOP(setAnalogValue(value)); PINOP(setAnalogValue(value));
@ -117,7 +117,7 @@ namespace pins {
* @param name analog pin to set period to * @param name analog pin to set period to
* @param micros period in micro seconds. eg:20000 * @param micros period in micro seconds. eg:20000
*/ */
//% shim=micro_bit::setAnalogPeriodUs help=pins/analog-set-period weight=23 //% help=pins/analog-set-period weight=23
//% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros" //% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros"
void analogSetPeriod(AnalogPin name, int micros) { void analogSetPeriod(AnalogPin name, int micros) {
PINOP(setAnalogPeriodUs(micros)); PINOP(setAnalogPeriodUs(micros));
@ -128,7 +128,7 @@ namespace pins {
* @param name pin to write to * @param name pin to write to
* @param value angle or rotation speed, eg:180,90,0 * @param value angle or rotation speed, eg:180,90,0
*/ */
//% help=pins/servo-write-pin weight=20 shim=micro_bit::servoWritePin //% help=pins/servo-write-pin weight=20
//% blockId=device_set_servo_pin block="servo write|pin %name|to %value" blockGap=8 //% blockId=device_set_servo_pin block="servo write|pin %name|to %value" blockGap=8
void servoWritePin(AnalogPin name, int value) { void servoWritePin(AnalogPin name, int value) {
PINOP(setServoValue(value)); PINOP(setServoValue(value));
@ -139,7 +139,7 @@ namespace pins {
* @param name pin name * @param name pin name
* @param micros pulse duration in micro seconds, eg:1500 * @param micros pulse duration in micro seconds, eg:1500
*/ */
//% shim=micro_bit::setServoPulseUs help=pins/serial-set-pulse weight=19 //% help=pins/serial-set-pulse weight=19
//% blockId=device_set_servo_pulse block="servo set pulse|pin %value|to (µs) %micros" //% blockId=device_set_servo_pulse block="servo set pulse|pin %value|to (µs) %micros"
void servoSetPulse(AnalogPin name, int micros) { void servoSetPulse(AnalogPin name, int micros) {
PINOP(setServoPulseUs(micros)); PINOP(setServoPulseUs(micros));
@ -152,7 +152,7 @@ namespace pins {
* Sets the pin used when using `pins->analog pitch`. * Sets the pin used when using `pins->analog pitch`.
* @param name TODO * @param name TODO
*/ */
//% shim=micro_bit::enablePitch help=pins/analog-set-pitch weight=12 //% help=pins/analog-set-pitch weight=12
void analogSetPitchPin(AnalogPin name) { void analogSetPitchPin(AnalogPin name) {
pitchPin = getPin((int)name); pitchPin = getPin((int)name);
} }
@ -162,7 +162,7 @@ namespace pins {
* @param frequency TODO * @param frequency TODO
* @param ms TODO * @param ms TODO
*/ */
//% shim=micro_bit::pitch help=pins/analog-pitch weight=14 async //% help=pins/analog-pitch weight=14 async
void analogPitch(int frequency, int ms) { void analogPitch(int frequency, int ms) {
if (pitchPin == NULL) return; if (pitchPin == NULL) return;
if (frequency <= 0) { if (frequency <= 0) {