denko 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build_megaavr.yml +1 -1
- data/CHANGELOG.md +40 -0
- data/DEPS_CLI.md +5 -0
- data/DEPS_IDE.md +5 -0
- data/HARDWARE.md +20 -12
- data/README.md +1 -1
- data/benchmarks/i2c_ssd1306_refresh.rb +7 -2
- data/examples/pulse_io/buzzer.rb +0 -40
- data/lib/denko/board/led_array.rb +3 -6
- data/lib/denko/message.rb +1 -1
- data/lib/denko/version.rb +1 -1
- data/src/denko_wifi.ino +38 -3
- data/src/lib/Denko.cpp +0 -9
- data/src/lib/Denko.h +1 -2
- data/src/lib/DenkoDefines.h +14 -6
- data/src/lib/DenkoLEDArray.cpp +4 -10
- data/target.yml +1 -35
- data/test/analog_io/input_test.rb +3 -3
- data/test/analog_io/output_test.rb +1 -1
- data/test/analog_io/potentiometer_test.rb +2 -2
- data/test/behaviors/bus_peripheral_addressed.rb +1 -1
- data/test/behaviors/bus_peripheral_test.rb +1 -1
- data/test/behaviors/callbacks_test.rb +4 -4
- data/test/behaviors/component_test.rb +2 -2
- data/test/behaviors/listener_test.rb +3 -3
- data/test/behaviors/poller_test.rb +3 -3
- data/test/behaviors/reader_test.rb +4 -4
- data/test/behaviors/subcomponents_test.rb +1 -1
- data/test/behaviors/threaded_test.rb +7 -7
- data/test/board/board_test.rb +8 -8
- data/test/board/core_test.rb +12 -12
- data/test/board/eeprom_test.rb +2 -2
- data/test/board/i2c_test.rb +5 -5
- data/test/board/infrared_test.rb +1 -1
- data/test/board/message_test.rb +1 -1
- data/test/board/one_wire_test.rb +4 -4
- data/test/board/pulse_test.rb +2 -2
- data/test/board/servo_test.rb +3 -3
- data/test/board/spi_test.rb +3 -3
- data/test/board/tone_test.rb +2 -2
- data/test/connection/serial_test.rb +13 -13
- data/test/digital_io/input_test.rb +7 -7
- data/test/digital_io/output_test.rb +5 -5
- data/test/digital_io/rotary_encoder_test.rb +4 -4
- data/test/display/hd44780_test.rb +1 -1
- data/test/eeprom/built_in_test.rb +1 -1
- data/test/i2c/bus_test.rb +5 -5
- data/test/i2c/peripheral_test.rb +4 -4
- data/test/led/base_test.rb +2 -2
- data/test/led/rgb_test.rb +6 -6
- data/test/led/seven_segment_test.rb +8 -8
- data/test/motor/servo_test.rb +6 -6
- data/test/motor/stepper_test.rb +5 -5
- data/test/one_wire/bus_test.rb +9 -9
- data/test/one_wire/peripheral_test.rb +17 -17
- data/test/pulse_io/buzzer_test.rb +4 -4
- data/test/pulse_io/ir_transmitter_test.rb +2 -2
- data/test/pulse_io/pwm_output_test.rb +4 -4
- data/test/rtc/ds3231_test.rb +4 -4
- data/test/sensor/dht_test.rb +3 -3
- data/test/sensor/ds18b20_test.rb +9 -9
- data/test/spi/bus_test.rb +4 -4
- data/test/spi/input_register_test.rb +8 -8
- data/test/spi/output_register_test.rb +4 -4
- data/test/uart/bitbang_test.rb +3 -3
- metadata +2 -357
- data/vendor/board-maps/.gitignore +0 -56
- data/vendor/board-maps/.gitmodules +0 -24
- data/vendor/board-maps/BoardMap.h +0 -1392
- data/vendor/board-maps/README.md +0 -52
- data/vendor/board-maps/lib/boards_parser.rb +0 -66
- data/vendor/board-maps/lib/header_parser.rb +0 -189
- data/vendor/board-maps/run.rb +0 -57
- data/vendor/board-maps/yaml/0XCB_HELIOS.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_REVTFT.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_TFT.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3.yml +0 -34
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_NOPSRAM.yml +0 -34
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_REVTFT.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_TFT.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32_V2.yml +0 -34
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_CAN.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_DVI.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_PROP_MAKER.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_RFM.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_SCORPIO.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_THINKINK.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_USB_HOST.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_ESP32.yml +0 -24
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_KB2040_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_MACROPAD_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_MATRIXPORTAL_ESP32S3.yml +0 -16
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32C3.yml +0 -12
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S2.yml +0 -22
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_N4R2.yml +0 -20
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_NOPSRAM.yml +0 -20
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32_PICO.yml +0 -28
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_STEMMAFRIEND_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_TRINKEYQT_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ALKS.yml +0 -34
- data/vendor/board-maps/yaml/AMPERKA_WIFI_SLOT.yml +0 -16
- data/vendor/board-maps/yaml/ARTRONSHOP_RP2_NANO.yml +0 -32
- data/vendor/board-maps/yaml/AVR_ADK.yml +0 -24
- data/vendor/board-maps/yaml/AVR_BT.yml +0 -16
- data/vendor/board-maps/yaml/AVR_CIRCUITPLAY.yml +0 -14
- data/vendor/board-maps/yaml/AVR_DUEMILANOVE.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ESPLORA.yml +0 -20
- data/vendor/board-maps/yaml/AVR_ETHERNET.yml +0 -16
- data/vendor/board-maps/yaml/AVR_FIO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_GEMMA.yml +0 -6
- data/vendor/board-maps/yaml/AVR_INDUSTRIAL101.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LEONARDO.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LEONARDO_ETH.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LILYPAD.yml +0 -16
- data/vendor/board-maps/yaml/AVR_LILYPAD_USB.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LININO_ONE.yml +0 -20
- data/vendor/board-maps/yaml/AVR_MEGA.yml +0 -24
- data/vendor/board-maps/yaml/AVR_MEGA2560.yml +0 -24
- data/vendor/board-maps/yaml/AVR_MICRO.yml +0 -20
- data/vendor/board-maps/yaml/AVR_MINI.yml +0 -16
- data/vendor/board-maps/yaml/AVR_NANO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_NANO_EVERY.yml +0 -22
- data/vendor/board-maps/yaml/AVR_NG.yml +0 -16
- data/vendor/board-maps/yaml/AVR_PRO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ROBOT_CONTROL.yml +0 -22
- data/vendor/board-maps/yaml/AVR_ROBOT_MOTOR.yml +0 -19
- data/vendor/board-maps/yaml/AVR_UNO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_DEV_ED.yml +0 -16
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_REV2.yml +0 -22
- data/vendor/board-maps/yaml/AVR_YUN.yml +0 -20
- data/vendor/board-maps/yaml/AVR_YUNMINI.yml +0 -20
- data/vendor/board-maps/yaml/AirM2M_CORE_ESP32C3.yml +0 -14
- data/vendor/board-maps/yaml/BEE_DATA_LOGGER.yml +0 -39
- data/vendor/board-maps/yaml/BPI_BIT.yml +0 -9
- data/vendor/board-maps/yaml/BPI_LEAF_S3.yml +0 -41
- data/vendor/board-maps/yaml/BRIDGETEK_IDM2040-7A.yml +0 -48
- data/vendor/board-maps/yaml/BeeMotionS3.yml +0 -45
- data/vendor/board-maps/yaml/Bee_Motion.yml +0 -30
- data/vendor/board-maps/yaml/Bee_Motion_Mini.yml +0 -1
- data/vendor/board-maps/yaml/Bee_S3.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_2040_LORA_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_LTE_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_2040_NFC_RP2040.yml +0 -32
- data/vendor/board-maps/yaml/CHALLENGER_2040_SDRTC_RP2040.yml +0 -36
- data/vendor/board-maps/yaml/CHALLENGER_2040_SUBGHZ_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_UWB_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI6_BLE_RP2040.yml +0 -42
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_BLE_RP2040.yml +0 -42
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_NB_2040_WIFI_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CRABIK_SLOT_ESP32_S3.yml +0 -19
- data/vendor/board-maps/yaml/CYTRON_MAKER_FEATHER_AIOT_S3.yml +0 -29
- data/vendor/board-maps/yaml/CYTRON_MAKER_NANO_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/CYTRON_MAKER_PI_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/CoreESP32.yml +0 -53
- data/vendor/board-maps/yaml/D1_MINI32.yml +0 -45
- data/vendor/board-maps/yaml/D1_UNO32.yml +0 -28
- data/vendor/board-maps/yaml/DATANOISETV_PICOADK.yml +0 -48
- data/vendor/board-maps/yaml/DENKY.yml +0 -35
- data/vendor/board-maps/yaml/DENKY_PICOV3.yml +0 -35
- data/vendor/board-maps/yaml/DENKY_WROOM32.yml +0 -35
- data/vendor/board-maps/yaml/DEPARTMENT_OF_ALCHEMY_MINIMAIN_ESP32S2.yml +0 -26
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_ESP32_C3.yml +0 -14
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32E.yml +0 -49
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32S3.yml +0 -38
- data/vendor/board-maps/yaml/DFROBOT_ROMEO_ESP32S3.yml +0 -7
- data/vendor/board-maps/yaml/DPU_ESP32.yml +0 -35
- data/vendor/board-maps/yaml/DYDK.yml +0 -38
- data/vendor/board-maps/yaml/DYDK1A.yml +0 -37
- data/vendor/board-maps/yaml/DYDK1Av2.yml +0 -45
- data/vendor/board-maps/yaml/DYG.yml +0 -20
- data/vendor/board-maps/yaml/DYM.yml +0 -40
- data/vendor/board-maps/yaml/DYMv2.yml +0 -39
- data/vendor/board-maps/yaml/D_Duino_32.yml +0 -37
- data/vendor/board-maps/yaml/ELECTRONICCATS_HUNTERCAT_NFC.yml +0 -44
- data/vendor/board-maps/yaml/ESP320.yml +0 -8
- data/vendor/board-maps/yaml/ESP32C3_DEV.yml +0 -14
- data/vendor/board-maps/yaml/ESP32C3_M1_I_KIT.yml +0 -13
- data/vendor/board-maps/yaml/ESP32S2_DEV.yml +0 -43
- data/vendor/board-maps/yaml/ESP32S2_THING_PLUS.yml +0 -44
- data/vendor/board-maps/yaml/ESP32S2_USB.yml +0 -43
- data/vendor/board-maps/yaml/ESP32S3_CAM_LCD.yml +0 -7
- data/vendor/board-maps/yaml/ESP32S3_DEV.yml +0 -38
- data/vendor/board-maps/yaml/ESP32_DEV.yml +0 -35
- data/vendor/board-maps/yaml/ESP32_DEVKIT_LIPO.yml +0 -35
- data/vendor/board-maps/yaml/ESP32_EVB.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_GATEWAY.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_C.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_E.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_F.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_IOT_REDBOARD.yml +0 -36
- data/vendor/board-maps/yaml/ESP32_MICROMOD.yml +0 -24
- data/vendor/board-maps/yaml/ESP32_PICO.yml +0 -35
- data/vendor/board-maps/yaml/ESP32_POE.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_POE_ISO.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_S3_BOX.yml +0 -19
- data/vendor/board-maps/yaml/ESP32_S3_USB_OTG.yml +0 -11
- data/vendor/board-maps/yaml/ESP32_THING.yml +0 -36
- data/vendor/board-maps/yaml/ESP32_THING_PLUS.yml +0 -33
- data/vendor/board-maps/yaml/ESP32_THING_PLUS_C.yml +0 -33
- data/vendor/board-maps/yaml/ESP32_WROOM_DA.yml +0 -35
- data/vendor/board-maps/yaml/ESP32_WROVER_KIT.yml +0 -35
- data/vendor/board-maps/yaml/ESP8266_ADAFRUIT_HUZZAH.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_AGRUMINO_LEMON_V4.yml +0 -8
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_PRIMO.yml +0 -7
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_STAR_OTTO.yml +0 -7
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_UNOWIFI.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESP01.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESP07.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_ESP12.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_ESP13.yml +0 -17
- data/vendor/board-maps/yaml/ESP8266_ESP210.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPECTRO_CORE.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP12.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP13.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V1.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V2.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_GENERIC.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_INVENT_ONE.yml +0 -22
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12E.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_OAK.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V1.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V2.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SCHIRMILABS_EDUINO_WIFI.yml +0 -25
- data/vendor/board-maps/yaml/ESP8266_SONOFF_BASIC.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_S20.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_SV.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_TH.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_THING.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_THING_DEV.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINI.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINILITE.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINIPRO.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1R1.yml +0 -25
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1WROOM02.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WIO_LINK.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_XINABOX_CW01.yml +0 -9
- data/vendor/board-maps/yaml/ESPECTRO32.yml +0 -36
- data/vendor/board-maps/yaml/ESPea32.yml +0 -36
- data/vendor/board-maps/yaml/ESPino32.yml +0 -36
- data/vendor/board-maps/yaml/ET-Board.yml +0 -26
- data/vendor/board-maps/yaml/EXTREMEELEXTRONICS_RC2040.yml +0 -46
- data/vendor/board-maps/yaml/Edgebox-ESP-100.yml +0 -7
- data/vendor/board-maps/yaml/FEATHERS2.yml +0 -43
- data/vendor/board-maps/yaml/FEATHERS2NEO.yml +0 -31
- data/vendor/board-maps/yaml/FEATHERS3.yml +0 -32
- data/vendor/board-maps/yaml/FEATHER_ESP32.yml +0 -32
- data/vendor/board-maps/yaml/FLYBOARD2040_CORE.yml +0 -48
- data/vendor/board-maps/yaml/FRANZININHO_WIFI.yml +0 -43
- data/vendor/board-maps/yaml/FRANZININHO_WIFI_MSC.yml +0 -43
- data/vendor/board-maps/yaml/FROG_ESP32.yml +0 -35
- data/vendor/board-maps/yaml/FUNHOUSE_ESP32S2.yml +0 -22
- data/vendor/board-maps/yaml/GEN4_IOD.yml +0 -9
- data/vendor/board-maps/yaml/GENERIC_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/HEALTHYPI_4.yml +0 -36
- data/vendor/board-maps/yaml/HONEYLEMON.yml +0 -36
- data/vendor/board-maps/yaml/HORNBILL_ESP32_DEV.yml +0 -36
- data/vendor/board-maps/yaml/HORNBILL_ESP32_MINIMA.yml +0 -19
- data/vendor/board-maps/yaml/ILABS_2040_RPICO32_RP2040.yml +0 -47
- data/vendor/board-maps/yaml/IMBRIOS_LOGSENS_V1P1.yml +0 -23
- data/vendor/board-maps/yaml/INTOROBOT_ESP32_DEV.yml +0 -34
- data/vendor/board-maps/yaml/LILYGO_T_DISPLAY_S3.yml +0 -32
- data/vendor/board-maps/yaml/LOLIN32.yml +0 -36
- data/vendor/board-maps/yaml/LOLIN32_LITE.yml +0 -36
- data/vendor/board-maps/yaml/LOLIN_C3_MINI.yml +0 -14
- data/vendor/board-maps/yaml/LOLIN_D32.yml +0 -36
- data/vendor/board-maps/yaml/LOLIN_D32_PRO.yml +0 -36
- data/vendor/board-maps/yaml/LOLIN_S2_MINI.yml +0 -44
- data/vendor/board-maps/yaml/LOLIN_S2_PICO.yml +0 -44
- data/vendor/board-maps/yaml/LOLIN_S3.yml +0 -40
- data/vendor/board-maps/yaml/LOLIN_S3_MINI.yml +0 -40
- data/vendor/board-maps/yaml/LOLIN_S3_PRO.yml +0 -40
- data/vendor/board-maps/yaml/Lion_Bit_Dev_Board.yml +0 -18
- data/vendor/board-maps/yaml/LoPy.yml +0 -37
- data/vendor/board-maps/yaml/LoPy4.yml +0 -37
- data/vendor/board-maps/yaml/M5STACK_CORES3.yml +0 -8
- data/vendor/board-maps/yaml/M5STACK_Core2.yml +0 -9
- data/vendor/board-maps/yaml/M5STACK_FIRE.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack-Timer-CAM.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_ATOM.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_ATOMS3.yml +0 -7
- data/vendor/board-maps/yaml/M5Stack_CoreInk.yml +0 -9
- data/vendor/board-maps/yaml/M5Stack_Core_ESP32.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_Station.yml +0 -10
- data/vendor/board-maps/yaml/M5Stick_C.yml +0 -10
- data/vendor/board-maps/yaml/MAGTAG29_ESP32S2.yml +0 -31
- data/vendor/board-maps/yaml/MELOPERO_COOKIE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/MELOPERO_SHAKE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/METRO_ESP32S2.yml +0 -44
- data/vendor/board-maps/yaml/MGBOT_IOTIK32A.yml +0 -36
- data/vendor/board-maps/yaml/MGBOT_IOTIK32B.yml +0 -36
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32DEVKIT.yml +0 -36
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32MINIKIT.yml +0 -36
- data/vendor/board-maps/yaml/MICROS2.yml +0 -44
- data/vendor/board-maps/yaml/MINIMA.yml +0 -15
- data/vendor/board-maps/yaml/MOD_WIFI_ESP8266.yml +0 -9
- data/vendor/board-maps/yaml/Metro.yml +0 -8
- data/vendor/board-maps/yaml/NANO32.yml +0 -36
- data/vendor/board-maps/yaml/NANO_RP2040_CONNECT.yml +0 -35
- data/vendor/board-maps/yaml/NEBULAS3.yml +0 -33
- data/vendor/board-maps/yaml/NEKOSYSTEMS_BL2040_MINI.yml +0 -48
- data/vendor/board-maps/yaml/NULLBITS_BIT_C_PRO.yml +0 -48
- data/vendor/board-maps/yaml/Node32s.yml +0 -36
- data/vendor/board-maps/yaml/NodeMCU_32S.yml +0 -36
- data/vendor/board-maps/yaml/ODROID_ESP32.yml +0 -10
- data/vendor/board-maps/yaml/ONEHORSE_ESP32_DEV.yml +0 -34
- data/vendor/board-maps/yaml/OROCA_EDUBOT.yml +0 -33
- data/vendor/board-maps/yaml/PIMORONI_PGA2040.yml +0 -48
- data/vendor/board-maps/yaml/PIMORONI_PLASMA2040.yml +0 -29
- data/vendor/board-maps/yaml/PORTENTA_C33.yml +0 -28
- data/vendor/board-maps/yaml/PROS3.yml +0 -33
- data/vendor/board-maps/yaml/PYCOM_GPY.yml +0 -37
- data/vendor/board-maps/yaml/Piranha.yml +0 -22
- data/vendor/board-maps/yaml/Pocket32.yml +0 -36
- data/vendor/board-maps/yaml/QUANTUM.yml +0 -35
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO.yml +0 -48
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO_W.yml +0 -48
- data/vendor/board-maps/yaml/REDPILL_ESP32S3.yml +0 -42
- data/vendor/board-maps/yaml/RMP.yml +0 -43
- data/vendor/board-maps/yaml/SAMD_CIRCUITPLAYGROUND_EXPRESS.yml +0 -11
- data/vendor/board-maps/yaml/SAMD_MKR1000.yml +0 -20
- data/vendor/board-maps/yaml/SAMD_MKRFox1200.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRGSM1400.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_MKRNB1500.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_MKRVIDOR4000.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRWAN1300.yml +0 -18
- data/vendor/board-maps/yaml/SAMD_MKRWAN1310.yml +0 -18
- data/vendor/board-maps/yaml/SAMD_MKRWIFI1010.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRZERO.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_NANO_33_IOT.yml +0 -13
- data/vendor/board-maps/yaml/SAMD_TIAN.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_ZERO.yml +0 -14
- data/vendor/board-maps/yaml/SAM_DUE.yml +0 -28
- data/vendor/board-maps/yaml/SAM_ZERO.yml +0 -15
- data/vendor/board-maps/yaml/SEEED_INDICATOR_RP2040.yml +0 -47
- data/vendor/board-maps/yaml/SEEED_XIAO_RP2040.yml +0 -29
- data/vendor/board-maps/yaml/SOLDERPARTY_RP2040_STAMP.yml +0 -48
- data/vendor/board-maps/yaml/SONOFF_DUALR3.yml +0 -35
- data/vendor/board-maps/yaml/SPARKFUN_PROMICRO_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/SPARKFUN_THINGPLUS_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/STAMP_S3.yml +0 -4
- data/vendor/board-maps/yaml/TAMC_TERMOD_S3.yml +0 -41
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1262.yml +0 -28
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1268.yml +0 -28
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1276.yml +0 -28
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1278.yml +0 -28
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1280.yml +0 -28
- data/vendor/board-maps/yaml/TBeam.yml +0 -28
- data/vendor/board-maps/yaml/TINYPICO.yml +0 -35
- data/vendor/board-maps/yaml/TINYS2.yml +0 -43
- data/vendor/board-maps/yaml/TINYS3.yml +0 -25
- data/vendor/board-maps/yaml/TTGO-T-OI-PLUS_DEV.yml +0 -11
- data/vendor/board-maps/yaml/TTGO_LoRa32_V1.yml +0 -38
- data/vendor/board-maps/yaml/TTGO_LoRa32_V2.yml +0 -38
- data/vendor/board-maps/yaml/TTGO_LoRa32_v21new.yml +0 -38
- data/vendor/board-maps/yaml/TTGO_T1.yml +0 -36
- data/vendor/board-maps/yaml/TTGO_T7_V13_Mini32.yml +0 -36
- data/vendor/board-maps/yaml/TTGO_T7_V14_Mini32.yml +0 -36
- data/vendor/board-maps/yaml/TWATCH_2020_V1.yml +0 -9
- data/vendor/board-maps/yaml/TWATCH_2020_V2.yml +0 -9
- data/vendor/board-maps/yaml/TWATCH_2020_V3.yml +0 -9
- data/vendor/board-maps/yaml/TWATCH_BASE.yml +0 -9
- data/vendor/board-maps/yaml/TWatch.yml +0 -9
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver.yml +0 -18
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver_MK_II.yml +0 -18
- data/vendor/board-maps/yaml/UBLOX_NINA_W10.yml +0 -57
- data/vendor/board-maps/yaml/UBLOX_NORA_W10.yml +0 -43
- data/vendor/board-maps/yaml/UNOWIFIR4.yml +0 -17
- data/vendor/board-maps/yaml/UPESY_RP2040_DEVKIT.yml +0 -48
- data/vendor/board-maps/yaml/VALTRACK_V4_MFW_ESP32_C3.yml +0 -23
- data/vendor/board-maps/yaml/VALTRACK_V4_VTS_ESP32_C3.yml +0 -23
- data/vendor/board-maps/yaml/VIYALAB_MIZU_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/WATCHY.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V10.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V15.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V20.yml +0 -7
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_0_96.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_1_28.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ONE.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_PLUS.yml +0 -48
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ZERO.yml +0 -47
- data/vendor/board-maps/yaml/WESP32.yml +0 -17
- data/vendor/board-maps/yaml/WIDORA_AIR.yml +0 -34
- data/vendor/board-maps/yaml/WIFIDUINO_ESP8266.yml +0 -23
- data/vendor/board-maps/yaml/WIFINFO.yml +0 -20
- data/vendor/board-maps/yaml/WIPY3.yml +0 -37
- data/vendor/board-maps/yaml/WIZNET_5100S_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WIZNET_5500_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WIZNET_WIZFI360_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WT32_ETH01.yml +0 -8
- data/vendor/board-maps/yaml/WiFiduino32S3.yml +0 -27
- data/vendor/board-maps/yaml/WiFiduinoV2.yml +0 -27
- data/vendor/board-maps/yaml/Wifiduino32.yml +0 -40
- data/vendor/board-maps/yaml/XIAO_ESP32C3.yml +0 -22
- data/vendor/board-maps/yaml/XIAO_ESP32S3.yml +0 -37
- data/vendor/board-maps/yaml/YD_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/atmegazero_esp32s2.yml +0 -30
- data/vendor/board-maps/yaml/connaxio_espoir.yml +0 -24
- data/vendor/board-maps/yaml/esp32vn_iot_uno.yml +0 -31
- data/vendor/board-maps/yaml/fm_devkit.yml +0 -15
- data/vendor/board-maps/yaml/heltec_wifi_32_lora_V3.yml +0 -41
- data/vendor/board-maps/yaml/heltec_wifi_kit_32.yml +0 -38
- data/vendor/board-maps/yaml/heltec_wifi_kit_32_V3.yml +0 -42
- data/vendor/board-maps/yaml/heltec_wifi_lora_32.yml +0 -36
- data/vendor/board-maps/yaml/heltec_wifi_lora_32_V2.yml +0 -36
- data/vendor/board-maps/yaml/heltec_wireless_stick.yml +0 -36
- data/vendor/board-maps/yaml/heltec_wireless_stick_LITE.yml +0 -36
- data/vendor/board-maps/yaml/openkb.yml +0 -37
- data/vendor/board-maps/yaml/roboheart_hercules.yml +0 -26
- data/vendor/board-maps/yaml/sensesiot_weizen.yml +0 -35
- data/vendor/board-maps/yaml/uPesy_WROOM.yml +0 -36
- data/vendor/board-maps/yaml/uPesy_WROVER.yml +0 -36
- data/vendor/board-maps/yaml/unphone8.yml +0 -42
- data/vendor/board-maps/yaml/unphone9.yml +0 -42
- data/vendor/board-maps/yaml/wifi_kit_8.yml +0 -15
@@ -28,13 +28,13 @@ class ListenerTest < Minitest::Test
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_call_stop_before_listening
|
31
|
-
mock =
|
31
|
+
mock = Minitest::Mock.new.expect :call, nil
|
32
32
|
part.stub(:stop, mock) { part.listen }
|
33
33
|
mock.verify
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_call__listen
|
37
|
-
mock =
|
37
|
+
mock = Minitest::Mock.new
|
38
38
|
mock.expect :call, nil, [nil]
|
39
39
|
mock.expect :call, nil, [32]
|
40
40
|
part.stub(:_listen, mock) do
|
@@ -45,7 +45,7 @@ class ListenerTest < Minitest::Test
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def test_call__stop_listener
|
48
|
-
mock =
|
48
|
+
mock = Minitest::Mock.new.expect :call, nil
|
49
49
|
part.stub(:_stop_listener, mock) { part.stop }
|
50
50
|
mock.verify
|
51
51
|
end
|
@@ -37,13 +37,13 @@ class PollerTest < Minitest::Test
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_call_stop_before_polling
|
40
|
-
mock =
|
40
|
+
mock = Minitest::Mock.new.expect :call, nil
|
41
41
|
part.stub(:stop, mock) { part.poll(1) }
|
42
42
|
mock.verify
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_uses_threaded_loop
|
46
|
-
mock =
|
46
|
+
mock = Minitest::Mock.new.expect :call, nil
|
47
47
|
part.stub(:threaded_loop, mock) { part.poll(1) }
|
48
48
|
mock.verify
|
49
49
|
end
|
@@ -57,7 +57,7 @@ class PollerTest < Minitest::Test
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_stop_kills_thread
|
60
|
-
mock =
|
60
|
+
mock = Minitest::Mock.new.expect :call, nil
|
61
61
|
part.stub(:stop_thread, mock) { part.stop }
|
62
62
|
mock.verify
|
63
63
|
end
|
@@ -37,7 +37,7 @@ class ReaderTest < Minitest::Test
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_read_once
|
40
|
-
mock =
|
40
|
+
mock = Minitest::Mock.new.expect :call, nil
|
41
41
|
inject(1)
|
42
42
|
|
43
43
|
part.stub(:_read, mock) do
|
@@ -53,20 +53,20 @@ class ReaderTest < Minitest::Test
|
|
53
53
|
|
54
54
|
def test_read_using_with_lambda
|
55
55
|
inject(1)
|
56
|
-
reader =
|
56
|
+
reader = Minitest::Mock.new.expect :call, nil
|
57
57
|
part.read_using -> { reader.call }
|
58
58
|
reader.verify
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_read_using_with_method_and_args
|
62
62
|
inject(1)
|
63
|
-
reader =
|
63
|
+
reader = Minitest::Mock.new.expect :call, nil, [10, 20], test_arg: 2
|
64
64
|
part.read_using reader, 10, 20, test_arg: 2
|
65
65
|
reader.verify
|
66
66
|
end
|
67
67
|
|
68
68
|
def test_add_run_remove_callback
|
69
|
-
cb =
|
69
|
+
cb = Minitest::Mock.new.expect :call, nil
|
70
70
|
inject(1)
|
71
71
|
part.read { cb.call }
|
72
72
|
assert_nil part.callbacks[:read]
|
@@ -65,7 +65,7 @@ class SubcomponentsTest < Minitest::Test
|
|
65
65
|
pinless = PinlessComponentMock.new
|
66
66
|
board.add_component(pinless)
|
67
67
|
|
68
|
-
mock =
|
68
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
69
69
|
pinless.stub(:stop, mock) do
|
70
70
|
board.remove_component(pinless)
|
71
71
|
end
|
@@ -24,19 +24,19 @@ class ThreadedTest < Minitest::Test
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_threaded_stops_threads
|
27
|
-
mock =
|
27
|
+
mock = Minitest::Mock.new.expect :call, nil
|
28
28
|
part.stub(:stop_thread, mock) { part.threaded {} }
|
29
29
|
mock.verify
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_threaded_enables_interrupts
|
33
|
-
mock =
|
33
|
+
mock = Minitest::Mock.new.expect :call, nil
|
34
34
|
part.stub(:enable_interrupts, mock) { part.threaded {} }
|
35
35
|
mock.verify
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_threaded_calls_block_given
|
39
|
-
mock =
|
39
|
+
mock = Minitest::Mock.new.expect :call, nil
|
40
40
|
part.threaded { mock.call }
|
41
41
|
sleep 0.1 # Should find a better way to do this.
|
42
42
|
mock.verify
|
@@ -49,7 +49,7 @@ class ThreadedTest < Minitest::Test
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_threaded_loop_calls_block_repeatedly
|
52
|
-
mock =
|
52
|
+
mock = Minitest::Mock.new.expect(:call, nil).expect(:call, nil)
|
53
53
|
part.stub(:foo, mock) do
|
54
54
|
part.threaded_loop do
|
55
55
|
part.foo
|
@@ -61,7 +61,7 @@ class ThreadedTest < Minitest::Test
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def test_stop_thread_kills_thread
|
64
|
-
mock =
|
64
|
+
mock = Minitest::Mock.new.expect(:kill, nil)
|
65
65
|
part.instance_variable_set(:@thread, mock)
|
66
66
|
part.stop_thread
|
67
67
|
mock.verify
|
@@ -81,7 +81,7 @@ class ThreadedTest < Minitest::Test
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def test_original_method_called_when_interrupts_enabled
|
84
|
-
mock =
|
84
|
+
mock = Minitest::Mock.new.expect(:call, nil, ["denko"])
|
85
85
|
part.stub(:foo, mock) do
|
86
86
|
part.enable_interrupts
|
87
87
|
part.foo("denko")
|
@@ -91,7 +91,7 @@ class ThreadedTest < Minitest::Test
|
|
91
91
|
|
92
92
|
def test_interrupt_stops_thread
|
93
93
|
part.enable_interrupts
|
94
|
-
mock =
|
94
|
+
mock = Minitest::Mock.new.expect :call, nil
|
95
95
|
part.stub(:stop_thread, mock) { part. foo }
|
96
96
|
mock.verify
|
97
97
|
end
|
data/test/board/board_test.rb
CHANGED
@@ -15,7 +15,7 @@ class BoardTest < Minitest::Test
|
|
15
15
|
|
16
16
|
def test_starts_observing_connection
|
17
17
|
io = ConnectionMock.new
|
18
|
-
mock =
|
18
|
+
mock = Minitest::Mock.new.expect(:call, nil, [Denko::Board])
|
19
19
|
io.stub(:add_observer, mock) do
|
20
20
|
Denko::Board.new(io)
|
21
21
|
end
|
@@ -23,7 +23,7 @@ class BoardTest < Minitest::Test
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_calls_handshake_on_connection
|
26
|
-
mock =
|
26
|
+
mock = Minitest::Mock.new.expect(:call, Constants::ACK)
|
27
27
|
connection.stub(:handshake, mock) do
|
28
28
|
Denko::Board.new(connection)
|
29
29
|
end
|
@@ -49,7 +49,7 @@ class BoardTest < Minitest::Test
|
|
49
49
|
assert_equal 1023, board.analog_read_high
|
50
50
|
assert_equal 10, board.analog_read_resolution
|
51
51
|
|
52
|
-
mock =
|
52
|
+
mock = Minitest::Mock.new
|
53
53
|
mock.expect(:call, nil, [Denko::Message.encode(command:96, value:12)])
|
54
54
|
mock.expect(:call, nil, [Denko::Message.encode(command:97, value:12)])
|
55
55
|
board.stub(:write, mock) do
|
@@ -66,7 +66,7 @@ class BoardTest < Minitest::Test
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def test_eeprom
|
69
|
-
mock =
|
69
|
+
mock = Minitest::Mock.new.expect(:call, "test eeprom", [], board: board)
|
70
70
|
Denko::EEPROM::BuiltIn.stub(:new, mock) do
|
71
71
|
board.eeprom
|
72
72
|
end
|
@@ -75,7 +75,7 @@ class BoardTest < Minitest::Test
|
|
75
75
|
|
76
76
|
def test_write
|
77
77
|
board
|
78
|
-
mock =
|
78
|
+
mock = Minitest::Mock.new.expect(:call, nil, ["message"])
|
79
79
|
connection.stub(:write, mock) do
|
80
80
|
board.write("message")
|
81
81
|
end
|
@@ -83,16 +83,16 @@ class BoardTest < Minitest::Test
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def test_update_passes_messages_to_correct_components
|
86
|
-
mock1 =
|
86
|
+
mock1 = Minitest::Mock.new.expect(:update, nil, ["data"])
|
87
87
|
3.times { mock1.expect(:pin, 1) }
|
88
88
|
|
89
89
|
# Make sure lines are split only on the first colon.
|
90
90
|
# Tests for string based pine names too.
|
91
|
-
mock2 =
|
91
|
+
mock2 = Minitest::Mock.new.expect(:update, nil, ["with:colon"])
|
92
92
|
3.times { mock2.expect(:pin, 14) }
|
93
93
|
|
94
94
|
# Special EEPROM mock.
|
95
|
-
mock3 =
|
95
|
+
mock3 = Minitest::Mock.new.expect(:update, nil, ["bytes"])
|
96
96
|
3.times { mock3.expect(:pin, 254) }
|
97
97
|
|
98
98
|
board.add_component(mock1)
|
data/test/board/core_test.rb
CHANGED
@@ -12,7 +12,7 @@ class BoardCoreTest < Minitest::Test
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_set_pin_mode
|
15
|
-
mock =
|
15
|
+
mock = Minitest::Mock.new
|
16
16
|
mock.expect(:call, nil, [Denko::Message.encode(command: 0, pin: 1, value: 0b000)])
|
17
17
|
mock.expect(:call, nil, [Denko::Message.encode(command: 0, pin: 1, value: 0b010)])
|
18
18
|
mock.expect(:call, nil, [Denko::Message.encode(command: 0, pin: 1, value: 0b100)])
|
@@ -36,7 +36,7 @@ class BoardCoreTest < Minitest::Test
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_digital_write
|
39
|
-
mock =
|
39
|
+
mock = Minitest::Mock.new
|
40
40
|
mock.expect(:call, nil, [Denko::Message.encode(command: 1, pin: 1, value: board.low)])
|
41
41
|
mock.expect(:call, nil, [Denko::Message.encode(command: 1, pin: 1, value: board.high)])
|
42
42
|
|
@@ -50,7 +50,7 @@ class BoardCoreTest < Minitest::Test
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_digital_read
|
53
|
-
mock =
|
53
|
+
mock = Minitest::Mock.new
|
54
54
|
mock.expect(:call, nil, [Denko::Message.encode(command: 2, pin: 1)])
|
55
55
|
|
56
56
|
board.stub(:write, mock) do
|
@@ -60,7 +60,7 @@ class BoardCoreTest < Minitest::Test
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_pwm_write
|
63
|
-
mock =
|
63
|
+
mock = Minitest::Mock.new
|
64
64
|
mock.expect(:call, nil, [Denko::Message.encode(command: 3, pin: 1, value: board.low)])
|
65
65
|
mock.expect(:call, nil, [Denko::Message.encode(command: 3, pin: 1, value: board.pwm_high)])
|
66
66
|
mock.expect(:call, nil, [Denko::Message.encode(command: 3, pin: 1, value: 128)])
|
@@ -76,7 +76,7 @@ class BoardCoreTest < Minitest::Test
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_dac_write
|
79
|
-
mock =
|
79
|
+
mock = Minitest::Mock.new
|
80
80
|
mock.expect(:call, nil, [Denko::Message.encode(command: 4, pin: 1, value: board.low)])
|
81
81
|
mock.expect(:call, nil, [Denko::Message.encode(command: 4, pin: 1, value: board.dac_high)])
|
82
82
|
mock.expect(:call, nil, [Denko::Message.encode(command: 4, pin: 1, value: 128)])
|
@@ -92,7 +92,7 @@ class BoardCoreTest < Minitest::Test
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def test_analog_read
|
95
|
-
mock =
|
95
|
+
mock = Minitest::Mock.new
|
96
96
|
mock.expect(:call, nil, [Denko::Message.encode(command: 5, pin: 1)])
|
97
97
|
|
98
98
|
board.stub(:write, mock) do
|
@@ -102,7 +102,7 @@ class BoardCoreTest < Minitest::Test
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_set_listener
|
105
|
-
mock =
|
105
|
+
mock = Minitest::Mock.new
|
106
106
|
|
107
107
|
# \x00\x02 corresponds to the default digital divider of 4 (2^2).
|
108
108
|
# \x00\x04 corresponds to the default analog divider of 16 (2^4).
|
@@ -124,7 +124,7 @@ class BoardCoreTest < Minitest::Test
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def test_digital_listen
|
127
|
-
mock =
|
127
|
+
mock = Minitest::Mock.new
|
128
128
|
mock.expect(:call, nil, [1, :on], mode: :digital, divider: 4)
|
129
129
|
|
130
130
|
board.stub(:set_listener, mock) do
|
@@ -133,7 +133,7 @@ class BoardCoreTest < Minitest::Test
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def test_analog_listen
|
136
|
-
mock =
|
136
|
+
mock = Minitest::Mock.new
|
137
137
|
mock.expect(:call, nil, [1, :on], mode: :analog, divider: 16)
|
138
138
|
|
139
139
|
board.stub(:set_listener, mock) do
|
@@ -142,7 +142,7 @@ class BoardCoreTest < Minitest::Test
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def test_stop_listener
|
145
|
-
mock =
|
145
|
+
mock = Minitest::Mock.new
|
146
146
|
mock.expect(:call, nil, [1, :off])
|
147
147
|
|
148
148
|
board.stub(:set_listener, mock) do
|
@@ -151,7 +151,7 @@ class BoardCoreTest < Minitest::Test
|
|
151
151
|
end
|
152
152
|
|
153
153
|
def test_analog_resolution
|
154
|
-
mock =
|
154
|
+
mock = Minitest::Mock.new
|
155
155
|
mock.expect(:call, nil, [Denko::Message.encode(command: 96, value: 10)])
|
156
156
|
mock.expect(:call, nil, [Denko::Message.encode(command: 97, value: 10)])
|
157
157
|
|
@@ -170,7 +170,7 @@ class BoardCoreTest < Minitest::Test
|
|
170
170
|
def micro_delay
|
171
171
|
aux = pack(:uint16, [1000])
|
172
172
|
message = Denko::Message.encode command: 99, aux_message: aux
|
173
|
-
mock =
|
173
|
+
mock = Minitest::Mock.new.expect :call, nil, [message]
|
174
174
|
|
175
175
|
board.stub(:write, mock) do
|
176
176
|
board.micro_delay(1000)
|
data/test/board/eeprom_test.rb
CHANGED
@@ -12,7 +12,7 @@ class BoardEEPROMTest < Minitest::Test
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_eeprom_read
|
15
|
-
mock =
|
15
|
+
mock = Minitest::Mock.new
|
16
16
|
mock.expect :call, nil, [(Denko::Message.encode command: 7, value: 16, aux_message: pack(:uint16, 15))]
|
17
17
|
|
18
18
|
board.stub(:write, mock) do
|
@@ -23,7 +23,7 @@ class BoardEEPROMTest < Minitest::Test
|
|
23
23
|
|
24
24
|
def test_eeprom_write
|
25
25
|
data = (1..16).to_a
|
26
|
-
mock =
|
26
|
+
mock = Minitest::Mock.new
|
27
27
|
mock.expect :call, nil, [(Denko::Message.encode command: 8, value: data.length, aux_message: pack(:uint16, 15) + pack(:uint8, data))]
|
28
28
|
|
29
29
|
board.stub(:write, mock) do
|
data/test/board/i2c_test.rb
CHANGED
@@ -15,7 +15,7 @@ class APII2CTest < Minitest::Test
|
|
15
15
|
board
|
16
16
|
message = Denko::Message.encode command: 33
|
17
17
|
|
18
|
-
mock =
|
18
|
+
mock = Minitest::Mock.new.expect :call, nil, [message]
|
19
19
|
connection.stub(:write, mock) do
|
20
20
|
board.i2c_search
|
21
21
|
end
|
@@ -32,7 +32,7 @@ class APII2CTest < Minitest::Test
|
|
32
32
|
# Repeated start
|
33
33
|
message2 = Denko::Message.encode command: 34, pin: address | (0 << 7), value: 4, aux_message: aux
|
34
34
|
|
35
|
-
mock =
|
35
|
+
mock = Minitest::Mock.new
|
36
36
|
mock.expect :call, nil, [message1]
|
37
37
|
mock.expect :call, nil, [message2]
|
38
38
|
|
@@ -56,7 +56,7 @@ class APII2CTest < Minitest::Test
|
|
56
56
|
# Repeated start
|
57
57
|
message2 = Denko::Message.encode command: 35, pin: 0x30 | (0 << 7), value: 4, aux_message: aux
|
58
58
|
|
59
|
-
mock =
|
59
|
+
mock = Minitest::Mock.new
|
60
60
|
mock.expect :call, nil, [message1]
|
61
61
|
mock.expect :call, nil, [message2]
|
62
62
|
|
@@ -72,7 +72,7 @@ class APII2CTest < Minitest::Test
|
|
72
72
|
aux = pack(:uint8, 0x00) + pack(:uint8, [0])
|
73
73
|
message = Denko::Message.encode command: 35, pin: 0x30 | (1 << 7), value: 4, aux_message: aux
|
74
74
|
|
75
|
-
mock =
|
75
|
+
mock = Minitest::Mock.new
|
76
76
|
mock.expect :call, nil, [message]
|
77
77
|
|
78
78
|
connection.stub(:write, mock) do
|
@@ -97,7 +97,7 @@ class APII2CTest < Minitest::Test
|
|
97
97
|
messages << Denko::Message.encode(command: 34, pin: 0x30 | (1 << 7), value: 4, aux_message: pack(:uint8, code) + pack(:uint8, data))
|
98
98
|
end
|
99
99
|
|
100
|
-
mock =
|
100
|
+
mock = Minitest::Mock.new
|
101
101
|
messages.each do |message|
|
102
102
|
mock.expect :call, nil, [message]
|
103
103
|
end
|
data/test/board/infrared_test.rb
CHANGED
@@ -16,7 +16,7 @@ class APIInfraredTest < Minitest::Test
|
|
16
16
|
aux = pack(:uint8, 4) + pack(:uint16, [255,0,255,0])
|
17
17
|
message = Denko::Message.encode command: 16, pin: 8, value: 38, aux_message: aux
|
18
18
|
|
19
|
-
mock =
|
19
|
+
mock = Minitest::Mock.new.expect :call, nil, [message]
|
20
20
|
connection.stub(:write, mock) do
|
21
21
|
board.infrared_emit 8, 38, [255,0,255,0]
|
22
22
|
end
|
data/test/board/message_test.rb
CHANGED
@@ -25,7 +25,7 @@ class MessageTest < Minitest::Test
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_validates_aux_message_length
|
28
|
-
too_big_message = Array.new(
|
28
|
+
too_big_message = Array.new(785) { "a" }.join
|
29
29
|
assert_raises(ArgumentError) { Denko::Message.encode command: 0, value: 0, aux_message: too_big_message }
|
30
30
|
end
|
31
31
|
|
data/test/board/one_wire_test.rb
CHANGED
@@ -15,7 +15,7 @@ class APIOneWireTest < Minitest::Test
|
|
15
15
|
board
|
16
16
|
message = Denko::Message.encode command: 41, pin: 1, value: 255
|
17
17
|
|
18
|
-
mock =
|
18
|
+
mock = Minitest::Mock.new.expect :call, nil, [message]
|
19
19
|
connection.stub(:write, mock) do
|
20
20
|
board.one_wire_reset(1, 255)
|
21
21
|
end
|
@@ -26,7 +26,7 @@ class APIOneWireTest < Minitest::Test
|
|
26
26
|
board
|
27
27
|
message = Denko::Message.encode command: 42, pin: 1, aux_message: pack(:uint64, 128, max:8)
|
28
28
|
|
29
|
-
mock =
|
29
|
+
mock = Minitest::Mock.new.expect :call, nil, [message]
|
30
30
|
connection.stub(:write, mock) do
|
31
31
|
board.one_wire_search(1, 128)
|
32
32
|
end
|
@@ -40,7 +40,7 @@ class APIOneWireTest < Minitest::Test
|
|
40
40
|
message1 = Denko::Message.encode command: 43, pin: 1, value: 0b10000000 | 3, aux_message: pack(:uint8, [1,2,3])
|
41
41
|
message2 = Denko::Message.encode command: 43, pin: 1, value: 4, aux_message: pack(:uint8, [1,2,3,4])
|
42
42
|
|
43
|
-
mock =
|
43
|
+
mock = Minitest::Mock.new
|
44
44
|
mock.expect :call, nil, [message1]
|
45
45
|
mock.expect :call, nil, [message2]
|
46
46
|
connection.stub(:write, mock) do
|
@@ -60,7 +60,7 @@ class APIOneWireTest < Minitest::Test
|
|
60
60
|
board
|
61
61
|
message = Denko::Message.encode command: 44, pin: 1, value: 9
|
62
62
|
|
63
|
-
mock =
|
63
|
+
mock = Minitest::Mock.new.expect :call, nil, [message]
|
64
64
|
connection.stub(:write, mock) do
|
65
65
|
board.one_wire_read(1, 9)
|
66
66
|
end
|
data/test/board/pulse_test.rb
CHANGED
@@ -13,7 +13,7 @@ class BoardPulseTest < Minitest::Test
|
|
13
13
|
|
14
14
|
def test_pulse_read
|
15
15
|
# Default settings
|
16
|
-
mock =
|
16
|
+
mock = Minitest::Mock.new
|
17
17
|
aux = pack(:uint16, [0, 200]) << pack(:uint8, 100)
|
18
18
|
message = Denko::Message.encode command: 9, pin: 4, value: 0b00, aux_message: aux
|
19
19
|
|
@@ -24,7 +24,7 @@ class BoardPulseTest < Minitest::Test
|
|
24
24
|
mock.verify
|
25
25
|
|
26
26
|
# Good options
|
27
|
-
mock =
|
27
|
+
mock = Minitest::Mock.new
|
28
28
|
aux = pack(:uint16, [1000, 200]) << pack(:uint8, 160)
|
29
29
|
message1 = Denko::Message.encode command: 9, pin: 4, value: 0b01, aux_message: aux
|
30
30
|
message2 = Denko::Message.encode command: 9, pin: 4, value: 0b11, aux_message: aux
|
data/test/board/servo_test.rb
CHANGED
@@ -12,7 +12,7 @@ class APIServoTest < Minitest::Test
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_on_off
|
15
|
-
mock =
|
15
|
+
mock = Minitest::Mock.new
|
16
16
|
aux = pack :uint16, [544, 2400]
|
17
17
|
mock.expect :call, nil, [Denko::Message.encode(command: 10, pin: 9, value: 1, aux_message: aux)]
|
18
18
|
mock.expect :call, nil, [Denko::Message.encode(command: 10, pin: 9, value: 0, aux_message: aux)]
|
@@ -25,7 +25,7 @@ class APIServoTest < Minitest::Test
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_min_max
|
28
|
-
mock =
|
28
|
+
mock = Minitest::Mock.new
|
29
29
|
aux = pack :uint16, [360, 2100]
|
30
30
|
mock.expect :call, nil, [Denko::Message.encode(command: 10, pin: 9, value: 1, aux_message: aux)]
|
31
31
|
|
@@ -36,7 +36,7 @@ class APIServoTest < Minitest::Test
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_write
|
39
|
-
mock =
|
39
|
+
mock = Minitest::Mock.new
|
40
40
|
mock.expect :call, nil, [Denko::Message.encode(command: 11, pin: 9, aux_message: pack(:uint16, 180))]
|
41
41
|
|
42
42
|
board.stub(:write, mock) do
|
data/test/board/spi_test.rb
CHANGED
@@ -64,7 +64,7 @@ class APISPITest < Minitest::Test
|
|
64
64
|
bytes = [1,2,3,4]
|
65
65
|
header = board.spi_header(bytes, 4, 8000000, 2, :lsbfirst)
|
66
66
|
aux = header + pack(:uint8, bytes)
|
67
|
-
mock =
|
67
|
+
mock = Minitest::Mock.new.expect :call, nil,
|
68
68
|
[Denko::Message.encode(command: 26, pin: 3, aux_message: aux)]
|
69
69
|
|
70
70
|
board.stub(:write, mock) do
|
@@ -77,7 +77,7 @@ class APISPITest < Minitest::Test
|
|
77
77
|
def test_spi_listen
|
78
78
|
board
|
79
79
|
header = board.spi_header([], 8, 1000000, 0, :lsbfirst)
|
80
|
-
mock =
|
80
|
+
mock = Minitest::Mock.new.expect :call, nil,
|
81
81
|
[Denko::Message.encode(command: 27, pin: 3, aux_message: header)]
|
82
82
|
|
83
83
|
board.stub(:write, mock) do
|
@@ -88,7 +88,7 @@ class APISPITest < Minitest::Test
|
|
88
88
|
|
89
89
|
def test_spi_stop
|
90
90
|
board
|
91
|
-
mock =
|
91
|
+
mock = Minitest::Mock.new.expect :call, nil, [Denko::Message.encode(command: 28, pin: 3)]
|
92
92
|
board.stub(:write, mock) do
|
93
93
|
board.spi_stop(3)
|
94
94
|
end
|
data/test/board/tone_test.rb
CHANGED
@@ -12,7 +12,7 @@ class APIToneTest < Minitest::Test
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_tone
|
15
|
-
mock =
|
15
|
+
mock = Minitest::Mock.new
|
16
16
|
aux1 = pack(:uint16, 150) + pack(:uint16, 2000)
|
17
17
|
aux2 = pack(:uint16, 300)
|
18
18
|
|
@@ -31,7 +31,7 @@ class APIToneTest < Minitest::Test
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_no_tone
|
34
|
-
mock =
|
34
|
+
mock = Minitest::Mock.new
|
35
35
|
mock.expect :call, nil, [Denko::Message.encode(command: 18, pin: 10)]
|
36
36
|
|
37
37
|
board.stub(:write, mock) do
|
@@ -18,7 +18,7 @@ class SerialConnectionTest < Minitest::Test
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_connect_with_device_specified
|
21
|
-
mock =
|
21
|
+
mock = Minitest::Mock.new.expect(:call, "SerialMock", ["/dev/ttyACM0", 9600])
|
22
22
|
::Serial.stub(:new, mock) do
|
23
23
|
connection = Denko::Connection::Serial.new(device: "/dev/ttyACM0", baud: 9600)
|
24
24
|
assert_equal "SerialMock", suppress_output { connection.send(:io) }
|
@@ -34,7 +34,7 @@ class SerialConnectionTest < Minitest::Test
|
|
34
34
|
|
35
35
|
def test_connect_on_unix
|
36
36
|
connection.stub(:tty_devices, ['/dev/ttyACM0', '/dev/tty.usbmodem1']) do
|
37
|
-
mock =
|
37
|
+
mock = Minitest::Mock.new
|
38
38
|
# Raise error for first device
|
39
39
|
mock.expect(:call, nil) { raise RubySerial::Error }
|
40
40
|
mock.expect :call, "serial-obj", ['/dev/tty.usbmodem1', Denko::Connection::Serial::BAUD]
|
@@ -50,7 +50,7 @@ class SerialConnectionTest < Minitest::Test
|
|
50
50
|
# Simulate being on Windows
|
51
51
|
Constants.redefine(:RUBY_PLATFORM, "mswin", :on => Object)
|
52
52
|
|
53
|
-
mock =
|
53
|
+
mock = Minitest::Mock.new
|
54
54
|
# Raise error for COM1
|
55
55
|
mock.expect(:call, nil) { raise RubySerial::Error }
|
56
56
|
mock.expect :call, "serial-obj", ["COM2", Denko::Connection::Serial::BAUD]
|
@@ -65,11 +65,11 @@ class SerialConnectionTest < Minitest::Test
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_io_reset
|
68
|
-
flush_mock =
|
69
|
-
r_stop_mock =
|
70
|
-
r_start_mock =
|
71
|
-
w_stop_mock =
|
72
|
-
w_start_mock =
|
68
|
+
flush_mock = Minitest::Mock.new.expect :call, true
|
69
|
+
r_stop_mock = Minitest::Mock.new.expect :call, true
|
70
|
+
r_start_mock = Minitest::Mock.new.expect :call, true
|
71
|
+
w_stop_mock = Minitest::Mock.new.expect :call, true
|
72
|
+
w_start_mock = Minitest::Mock.new.expect :call, true
|
73
73
|
|
74
74
|
connection.stub(:flush_read, flush_mock) do
|
75
75
|
connection.stub(:stop_read, r_stop_mock) do
|
@@ -98,7 +98,7 @@ class SerialConnectionTest < Minitest::Test
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def test_parse
|
101
|
-
mock =
|
101
|
+
mock = Minitest::Mock.new.expect :call, nil, ['02:00:00']
|
102
102
|
connection.stub(:changed, true) do
|
103
103
|
connection.stub(:notify_observers, mock) do
|
104
104
|
connection.send(:parse, '02:00:00')
|
@@ -132,7 +132,7 @@ class SerialConnectionTest < Minitest::Test
|
|
132
132
|
connection.write('message')
|
133
133
|
|
134
134
|
# Message is written from buffer when we start the write thread.
|
135
|
-
mock =
|
135
|
+
mock = Minitest::Mock.new.expect :call, nil, ['message']
|
136
136
|
connection.stub(:_write, mock) do
|
137
137
|
# Start the write thread and wait for the buffer to empty.
|
138
138
|
connection.send(:start_write)
|
@@ -144,7 +144,7 @@ class SerialConnectionTest < Minitest::Test
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def test_io_read_single_chars_until_newline_and_strips_it
|
147
|
-
mock =
|
147
|
+
mock = Minitest::Mock.new
|
148
148
|
mock.expect :read, "line\n", [64]
|
149
149
|
connection.stub(:io, mock) do
|
150
150
|
assert_equal "line", connection.send(:read)
|
@@ -153,7 +153,7 @@ class SerialConnectionTest < Minitest::Test
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def test_io_read_handles_escaped_newlines_and_backslashes
|
156
|
-
mock =
|
156
|
+
mock = Minitest::Mock.new
|
157
157
|
mock.expect :read, "l1\\\nl2\\\\\n", [64]
|
158
158
|
connection.stub(:io, mock) do
|
159
159
|
assert_equal "l1\nl2\\", connection.send(:read)
|
@@ -162,7 +162,7 @@ class SerialConnectionTest < Minitest::Test
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def test_io_read_returns_empty_string_if_just_newline
|
165
|
-
mock =
|
165
|
+
mock = Minitest::Mock.new
|
166
166
|
mock.expect :read, "\n", [64]
|
167
167
|
connection.stub(:io, mock) do
|
168
168
|
assert_equal "", connection.send(:read)
|
@@ -10,7 +10,7 @@ class DigitalIOInputTest < Minitest::Test
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_start_listening_immediately
|
13
|
-
mock =
|
13
|
+
mock = Minitest::Mock.new.expect :call, nil, [14, 4]
|
14
14
|
board.stub(:digital_listen, mock) do
|
15
15
|
part
|
16
16
|
end
|
@@ -24,7 +24,7 @@ class DigitalIOInputTest < Minitest::Test
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test__read
|
27
|
-
mock =
|
27
|
+
mock = Minitest::Mock.new.expect :call, nil, [14]
|
28
28
|
board.stub(:digital_read, mock) do
|
29
29
|
part._read
|
30
30
|
end
|
@@ -33,7 +33,7 @@ class DigitalIOInputTest < Minitest::Test
|
|
33
33
|
|
34
34
|
def test__listen
|
35
35
|
part
|
36
|
-
mock =
|
36
|
+
mock = Minitest::Mock.new
|
37
37
|
mock.expect :call, nil, [14, 4]
|
38
38
|
mock.expect :call, nil, [14, 32]
|
39
39
|
board.stub(:digital_listen, mock) do
|
@@ -44,8 +44,8 @@ class DigitalIOInputTest < Minitest::Test
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_on_low
|
47
|
-
low_cb =
|
48
|
-
high_cb =
|
47
|
+
low_cb = Minitest::Mock.new.expect :call, nil
|
48
|
+
high_cb = Minitest::Mock.new
|
49
49
|
part.on_low { low_cb.call }
|
50
50
|
part.on_high { high_cb.call }
|
51
51
|
part.update(board.low)
|
@@ -54,8 +54,8 @@ class DigitalIOInputTest < Minitest::Test
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_on_high
|
57
|
-
low_cb =
|
58
|
-
high_cb =
|
57
|
+
low_cb = Minitest::Mock.new
|
58
|
+
high_cb = Minitest::Mock.new.expect :call, nil
|
59
59
|
part.on_low { low_cb.call }
|
60
60
|
part.on_high { high_cb.call }
|
61
61
|
part.update(board.high)
|