Skip to content

Commit

Permalink
Merge pull request #10 from KonradIT/master
Browse files Browse the repository at this point in the history
GoPro Mac Address fix, RTOS Thread fix.
  • Loading branch information
aster94 authored Mar 25, 2019
2 parents 072b7b8 + 6255cda commit 3fbc640
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 101 deletions.
192 changes: 98 additions & 94 deletions examples/ESP32_FreeRTOS/ESP32_FreeRTOS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,112 +15,116 @@ void setup()

void loop()
{
if (Serial.available() > 0)
if (Serial.available() > 0)
{
in = Serial.read();
//Serial.write(in);
}

switch (in)
{
default:
break;

// connect
case 'C':
gp.begin();
break;

// turn on/off
case 'T':
gp.turnOn();
break;

case 't':
gp.turnOff();
break;

// take a picture of start a video
case 'A':
gp.shoot();
break;

// stop the video
case 'S':
gp.stopShoot();
break;

//set modes
case 'V':
gp.setMode(VIDEO_MODE);
break;

case 'P':
gp.setMode(PHOTO_MODE);
break;

case 'M':
gp.setMode(MULTISHOT_MODE);
break;

// set orientation
case 'u':
gp.setOrientation(ORIENTATION_UP);
break;

case 'd':
gp.setOrientation(ORIENTATION_DOWN);
break;

case 'W':
gp.setVideoFov(MEDIUM_FOV);
break;

case 'E':
gp.setFrameRate(FR_120);
break;

case 'f':
gp.setPhotoResolution(PR_11MP_WIDE);
break;

case 'F':
gp.setVideoResolution(VR_1080p);
break;

case 'L':
gp.setTimeLapseInterval(60);
break;

case 'O':
gp.localizationOn();
break;

case 'I':
gp.localizationOff();
break;

case 'l':
gp.deleteLast();
break;

case 'D':
gp.deleteAll();
break;

case 'X':
gp.end();
break;

case 'p':
gp.printStatus();
break;
default:
break;

// connect
case 'C':
gp.begin();
break;

// turn on/off
case 'T':
gp.turnOn();
break;

case 't':
gp.turnOff();
break;

// take a picture of start a video
case 'A':
gp.shoot();
break;

// stop the video
case 'S':
gp.stopShoot();
break;

//set modes
case 'V':
gp.setMode(VIDEO_MODE);
break;

case 'P':
gp.setMode(PHOTO_MODE);
break;

case 'M':
gp.setMode(MULTISHOT_MODE);
break;

// set orientation
case 'u':
gp.setOrientation(ORIENTATION_UP);
break;

case 'd':
gp.setOrientation(ORIENTATION_DOWN);
break;

case 'W':
gp.setVideoFov(MEDIUM_FOV);
break;

case 'E':
gp.setFrameRate(FR_120);
break;

case 'f':
gp.setPhotoResolution(PR_11MP_WIDE);
break;

case 'F':
gp.setVideoResolution(VR_1080p);
break;

case 'L':
gp.setTimeLapseInterval(60);
break;

case 'O':
gp.localizationOn();
break;

case 'I':
gp.localizationOff();
break;

case 'l':
gp.deleteLast();
break;

case 'D':
gp.deleteAll();
break;

case 'X':
gp.end();
break;

case 'p':
gp.printStatus();
break;
}

in = 0;
}

void keep_alive(void *parameter)
{
gp.keepAlive();
while (gp.checkConnection(true)) {
gp.keepAlive();
Serial.println("KeepAlive sent");
}
vTaskDelete( NULL );
}
14 changes: 7 additions & 7 deletions src/GoProControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1355,18 +1355,18 @@ void GoProControl::printStatus()
if (_camera >= HERO4)
{
_debug_port->print("GoPro MAC:\t");
//WiFi.BSSID(mac);
_debug_port->print(mac[5], HEX);
uint8_t* gpMac = WiFi.BSSID();
_debug_port->print(gpMac[5],HEX);
_debug_port->print(":");
_debug_port->print(mac[4], HEX);
_debug_port->print(gpMac[4],HEX);
_debug_port->print(":");
_debug_port->print(mac[3], HEX);
_debug_port->print(gpMac[3],HEX);
_debug_port->print(":");
_debug_port->print(mac[2], HEX);
_debug_port->print(gpMac[2],HEX);
_debug_port->print(":");
_debug_port->print(mac[1], HEX);
_debug_port->print(gpMac[1],HEX);
_debug_port->print(":");
_debug_port->println(mac[0], HEX);
_debug_port->println(gpMac[0],HEX);
_debug_port->print("Board Name:\t");
_debug_port->println(_board_name);
}
Expand Down

0 comments on commit 3fbc640

Please sign in to comment.