diff --git a/.github/workflows/dynamixel2arduino_ci.yml b/.github/workflows/dynamixel2arduino_ci.yml new file mode 100644 index 0000000..0e5a810 --- /dev/null +++ b/.github/workflows/dynamixel2arduino_ci.yml @@ -0,0 +1,23 @@ +name: dynamixel2arduino_ci + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + dynamixel2arduino_ci: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Run Arduino CI Script + run: | + source <(curl -SLs https://raw.githubusercontent.com/ROBOTIS-GIT/Dynamixel2Arduino/master/install.sh) ${{github.ref}} + build_platform opencr + build_platform uno + build_platform mega2560 + build_platform mkrzero + build_platform portenta \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 04e68d4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: cpp -sudo: required -before_install: - - source <(curl -SLs https://raw.githubusercontent.com/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/install.sh) - -script: - - build_platform opencr - - build_platform uno - - build_platform mega2560 - - build_platform leonardo - - build_platform due - - build_platform zero - - build_platform mkrzero - - build_platform portenta - -notifications: - email: - on_success: change - on_failure: always - recipients: - - willson@robotis.com - -branches: - only: - - master - - develop diff --git a/examples/advanced/sync_read_write_raw/sync_read_write_raw.ino b/examples/advanced/sync_read_write_raw/sync_read_write_raw.ino index 66381d8..c6034a8 100644 --- a/examples/advanced/sync_read_write_raw/sync_read_write_raw.ino +++ b/examples/advanced/sync_read_write_raw/sync_read_write_raw.ino @@ -49,6 +49,7 @@ /* syncRead + DYNAMIXEL PROTOCOL 1.0 does NOT support Sync Read feature. Structures containing the necessary information to process the 'syncRead' packet. typedef struct XELInfoBulkRead{ @@ -68,6 +69,7 @@ */ /* syncWrite + DYNAMIXEL PROTOCOL 1.0 supports Control Table address up to 255. Structures containing the necessary information to process the 'syncWrite' packet. typedef struct XELInfoBulkWrite{ @@ -85,6 +87,8 @@ } __attribute__((packed)) InfoBulkWriteInst_t; */ +const uint8_t BROADCAST_ID = 254; +const float DYNAMIXEL_PROTOCOL_VERSION = 2.0; const uint8_t DXL_ID_CNT = 2; const uint8_t DXL_ID_LIST[DXL_ID_CNT] = {1, 2}; const uint16_t user_pkt_buf_cap = 128; @@ -123,12 +127,13 @@ void setup() { pinMode(LED_BUILTIN, OUTPUT); DEBUG_SERIAL.begin(115200); dxl.begin(57600); + dxl.setPortProtocolVersion(DYNAMIXEL_PROTOCOL_VERSION); for(i=0; i= 200){ sw_data[i].goal_velocity = 0; } @@ -214,7 +219,3 @@ void loop() { digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); delay(750); } - - - - diff --git a/install.sh b/install.sh index 98a120a..72bf0e5 100644 --- a/install.sh +++ b/install.sh @@ -10,7 +10,7 @@ fi # this will be eval'd in the functions below because arrays can't be exported # For creating a new main platform, please refer to https://arduino.github.io/arduino-cli/latest/platform-specification/#hardware-folders-structure # and https://arduino.github.io/arduino-cli/latest/platform-specification/#boardstxt -export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed:envie_m7")' +export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed_portenta:envie_m7")' # make display available for arduino CLI /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 @@ -55,7 +55,7 @@ DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:samd 2>&1) if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi echo -n "INSTALL Portenta H7: " -DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed 2>&1) +DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed_portenta 2>&1) if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi echo -n "INSTALL OpenCR: " diff --git a/library.properties b/library.properties index c50c228..fc74c97 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Dynamixel2Arduino -version=0.4.6 +version=0.4.7 author=ROBOTIS license=Apache-2.0 maintainer=Will Son(willson@robotis.com) diff --git a/src/dxl_c/protocol.c b/src/dxl_c/protocol.c index d8d9999..95de6f2 100644 --- a/src/dxl_c/protocol.c +++ b/src/dxl_c/protocol.c @@ -1,10 +1,7 @@ #include "protocol.h" -#if defined(ARDUINO) - #include - #if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_SAMD) - #include - #endif +#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED_PORTENTA) && !defined(ARDUINO_ARCH_SAMD) + #include #endif #if !defined(PROGMEM) diff --git a/src/dxl_c/protocol.h b/src/dxl_c/protocol.h index c3a212c..b586b56 100644 --- a/src/dxl_c/protocol.h +++ b/src/dxl_c/protocol.h @@ -17,6 +17,7 @@ #define DYNAMIXEL_PROTOCOL_H_ #include +#include #include #define DXL_BROADCAST_ID 0xFE diff --git a/src/utility/config.h b/src/utility/config.h index 333d63e..b932951 100644 --- a/src/utility/config.h +++ b/src/utility/config.h @@ -83,7 +83,7 @@ #if defined(ARDUINO) #include - #if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_SAMD) + #if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED_PORTENTA) && !defined(ARDUINO_ARCH_SAMD) #include #endif #endif