Loading .vscode/tasks.json +9 −6 Original line number Diff line number Diff line { "tasks": [ { "label": "arm build", "label": "arm build & run", "command": "sudo", "args": [ "sdk/run.sh", "-br", ], /*"group": { "group": { "kind": "build", "isDefault": true },*/ }, }, { "type": "cppbuild", "label": "x86 build", Loading @@ -26,12 +25,15 @@ "-Isrc/lib/ArduinoJson", "-Isrc/lib/uSockets", "-Isrc/lib/uWebSockets", "-Isrc/lib/easyexif", "-Lsrc/lib", "-pthread", "-lstdc++fs", "-l:uSockets_x86_64.a", "-l:exif_x86_64.a", "-o", "${workspaceFolder}/miphoto-x86" "${workspaceFolder}/miphoto-x86", ">output.txt" ], "options": { "cwd": "${workspaceFolder}/sdk" Loading @@ -41,9 +43,10 @@ ], "group": { "kind": "build", "isDefault": true "isDefault": false }, } ], "version": "2.0.0" } No newline at end of file sdk/build/miphoto/miphoto-exec +33.9 KiB (9.38 MiB) File changed.No diff preview for this file type. View original file View changed file sdk/run.sh +1 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ set -euo pipefail cd $(dirname $0) outfile="miphoto-exec" buildopts="-std=c++17 -Wno-psabi -static-libstdc++ -DUWS_NO_ZLIB -Isrc/lib/ArduinoJson -Isrc/lib/uSockets -Isrc/lib/uWebSockets -Isrc/lib/easyexif -Lsrc/lib -lpthread -lstdc++fs -l:uSockets.a" buildopts="-std=c++17 -Wno-psabi -static-libstdc++ -DUWS_NO_ZLIB -Isrc/lib/ArduinoJson -Isrc/lib/uSockets -Isrc/lib/uWebSockets -Isrc/lib/easyexif -Lsrc/lib -lpthread -lstdc++fs -l:uSockets.a -l:exif.a" usage=$(echo -e "Usage: run.sh [OPTIONS] \n\t-b\tbuild \n\t-r\tcopy to camera and run") Loading Loading @@ -46,4 +46,3 @@ if [ "$run" = true ] ; then cd ../.. ./telnet.exp /tmp/"$outfile" fi sdk/src/codes.cpp 0 → 100644 +52 −0 Original line number Diff line number Diff line #include "codes.h" using namespace std; int Codes::getSpeedMs(Speed speed) { if ((int)speed < 32768) { return 1000*(int)speed; } else { return 1000/((int)speed-32768); } }; string Codes::stateToString(int state) { switch (state) { case (int)ParamCameraState::Idle: return "idle"; case (int)ParamCameraState::Standby: return "standby"; case (int)ParamCameraState::Storage: return "storage"; case (int)ParamCameraState::Capturing: return "capturing"; case (int)ParamCameraState::CapturingMicro: return "capturing micro"; case (int)ParamCameraState::CapturingDelayed: return "capturing delayed"; case (int)ParamCameraState::Photoing: return "photoing"; case (int)ParamCameraState::PhotoingDelayed: return "photoing delayed"; case (int)ParamCameraState::PhotoingInterval: return "photoing interval"; case (int)ParamCameraState::CapturingSlow: return "capturing slow"; case (int)ParamCameraState::CapturingContinuous: return "capturing continuous"; case (int)ParamCameraState::CapturingSurroundexp: return "capturing surroundexp"; default: return "invalid"; } } sdk/src/codes.h +9 −45 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public: I1600 = 1600 }; enum class Speed { Auto = 0, Loading Loading @@ -125,6 +126,8 @@ public: S32 = 32, }; enum class ParamBracketingBuiltIn { EV0_5 = 1, Loading Loading @@ -172,54 +175,15 @@ public: }; static int getSpeedMs(Speed speed) { if ((int)speed < 32768) { return 1000*(int)speed; } else { return 1000/((int)speed-32768); } }; static int getSpeedMs(Speed speed); static std::string stateToString(int state) { switch (state) { case (int)ParamCameraState::Idle: return "idle"; case (int)ParamCameraState::Standby: return "standby"; case (int)ParamCameraState::Storage: return "storage"; case (int)ParamCameraState::Capturing: return "capturing"; case (int)ParamCameraState::CapturingMicro: return "capturing micro"; case (int)ParamCameraState::CapturingDelayed: return "capturing delayed"; case (int)ParamCameraState::Photoing: return "photoing"; case (int)ParamCameraState::PhotoingDelayed: return "photoing delayed"; case (int)ParamCameraState::PhotoingInterval: return "photoing interval"; case (int)ParamCameraState::CapturingSlow: return "capturing slow"; case (int)ParamCameraState::CapturingContinuous: return "capturing continuous"; case (int)ParamCameraState::CapturingSurroundexp: return "capturing surroundexp"; default: return "invalid"; } } static std::string stateToString(int state); private: }; #endif /* CODES_H */ Loading
.vscode/tasks.json +9 −6 Original line number Diff line number Diff line { "tasks": [ { "label": "arm build", "label": "arm build & run", "command": "sudo", "args": [ "sdk/run.sh", "-br", ], /*"group": { "group": { "kind": "build", "isDefault": true },*/ }, }, { "type": "cppbuild", "label": "x86 build", Loading @@ -26,12 +25,15 @@ "-Isrc/lib/ArduinoJson", "-Isrc/lib/uSockets", "-Isrc/lib/uWebSockets", "-Isrc/lib/easyexif", "-Lsrc/lib", "-pthread", "-lstdc++fs", "-l:uSockets_x86_64.a", "-l:exif_x86_64.a", "-o", "${workspaceFolder}/miphoto-x86" "${workspaceFolder}/miphoto-x86", ">output.txt" ], "options": { "cwd": "${workspaceFolder}/sdk" Loading @@ -41,9 +43,10 @@ ], "group": { "kind": "build", "isDefault": true "isDefault": false }, } ], "version": "2.0.0" } No newline at end of file
sdk/build/miphoto/miphoto-exec +33.9 KiB (9.38 MiB) File changed.No diff preview for this file type. View original file View changed file
sdk/run.sh +1 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ set -euo pipefail cd $(dirname $0) outfile="miphoto-exec" buildopts="-std=c++17 -Wno-psabi -static-libstdc++ -DUWS_NO_ZLIB -Isrc/lib/ArduinoJson -Isrc/lib/uSockets -Isrc/lib/uWebSockets -Isrc/lib/easyexif -Lsrc/lib -lpthread -lstdc++fs -l:uSockets.a" buildopts="-std=c++17 -Wno-psabi -static-libstdc++ -DUWS_NO_ZLIB -Isrc/lib/ArduinoJson -Isrc/lib/uSockets -Isrc/lib/uWebSockets -Isrc/lib/easyexif -Lsrc/lib -lpthread -lstdc++fs -l:uSockets.a -l:exif.a" usage=$(echo -e "Usage: run.sh [OPTIONS] \n\t-b\tbuild \n\t-r\tcopy to camera and run") Loading Loading @@ -46,4 +46,3 @@ if [ "$run" = true ] ; then cd ../.. ./telnet.exp /tmp/"$outfile" fi
sdk/src/codes.cpp 0 → 100644 +52 −0 Original line number Diff line number Diff line #include "codes.h" using namespace std; int Codes::getSpeedMs(Speed speed) { if ((int)speed < 32768) { return 1000*(int)speed; } else { return 1000/((int)speed-32768); } }; string Codes::stateToString(int state) { switch (state) { case (int)ParamCameraState::Idle: return "idle"; case (int)ParamCameraState::Standby: return "standby"; case (int)ParamCameraState::Storage: return "storage"; case (int)ParamCameraState::Capturing: return "capturing"; case (int)ParamCameraState::CapturingMicro: return "capturing micro"; case (int)ParamCameraState::CapturingDelayed: return "capturing delayed"; case (int)ParamCameraState::Photoing: return "photoing"; case (int)ParamCameraState::PhotoingDelayed: return "photoing delayed"; case (int)ParamCameraState::PhotoingInterval: return "photoing interval"; case (int)ParamCameraState::CapturingSlow: return "capturing slow"; case (int)ParamCameraState::CapturingContinuous: return "capturing continuous"; case (int)ParamCameraState::CapturingSurroundexp: return "capturing surroundexp"; default: return "invalid"; } }
sdk/src/codes.h +9 −45 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public: I1600 = 1600 }; enum class Speed { Auto = 0, Loading Loading @@ -125,6 +126,8 @@ public: S32 = 32, }; enum class ParamBracketingBuiltIn { EV0_5 = 1, Loading Loading @@ -172,54 +175,15 @@ public: }; static int getSpeedMs(Speed speed) { if ((int)speed < 32768) { return 1000*(int)speed; } else { return 1000/((int)speed-32768); } }; static int getSpeedMs(Speed speed); static std::string stateToString(int state) { switch (state) { case (int)ParamCameraState::Idle: return "idle"; case (int)ParamCameraState::Standby: return "standby"; case (int)ParamCameraState::Storage: return "storage"; case (int)ParamCameraState::Capturing: return "capturing"; case (int)ParamCameraState::CapturingMicro: return "capturing micro"; case (int)ParamCameraState::CapturingDelayed: return "capturing delayed"; case (int)ParamCameraState::Photoing: return "photoing"; case (int)ParamCameraState::PhotoingDelayed: return "photoing delayed"; case (int)ParamCameraState::PhotoingInterval: return "photoing interval"; case (int)ParamCameraState::CapturingSlow: return "capturing slow"; case (int)ParamCameraState::CapturingContinuous: return "capturing continuous"; case (int)ParamCameraState::CapturingSurroundexp: return "capturing surroundexp"; default: return "invalid"; } } static std::string stateToString(int state); private: }; #endif /* CODES_H */