-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor and strengthen the abstractions between UI and furble. Abstract all knowledge of the NimBLE library into the furble library. Rename Furble::Device to Furble::Camera. Abstract the device connection list into Furble::CameraList. Delete redundant Canon connect() implementations. Break the furble library dependency on M5ez, only UI includes it now. Try to autoconfig M5Unified in M5ez.begin(). * Bump M5Unified to 0.1.13. * Tweak M5Core font and UI. On M5Core the screen flickers during lightSleep(), so just delay instead. This needs further investigation and a proper fix. * Move ino to cpp. Arduino does strange things, avoid by just using cpp extensions. * Appease clang-format. * Refactor GPS handling code.
- Loading branch information
Showing
25 changed files
with
485 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef FURBLE_GPS_H | ||
#define FURBLE_GPS_H | ||
|
||
#include <Camera.h> | ||
#include <TinyGPS++.h> | ||
|
||
extern TinyGPSPlus furble_gps; | ||
|
||
extern bool furble_gps_enable; | ||
|
||
void furble_gps_init(void); | ||
void furble_gps_update_geodata(Furble::Camera *camera); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <NimBLEAdvertisedDevice.h> | ||
|
||
#include "Camera.h" | ||
|
||
namespace Furble { | ||
|
||
const char *Camera::getName(void) { | ||
return m_Name.c_str(); | ||
} | ||
|
||
void Camera::fillSaveName(char *name) { | ||
snprintf(name, 16, "%08llX", (uint64_t)m_Address); | ||
} | ||
|
||
void Camera::updateProgress(progressFunc pFunc, void *ctx, float value) { | ||
if (pFunc != nullptr) { | ||
(pFunc)(ctx, value); | ||
} | ||
} | ||
|
||
/** | ||
* Generate a 32-bit PRNG. | ||
*/ | ||
static uint32_t xorshift(uint32_t x) { | ||
/* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ | ||
x ^= x << 13; | ||
x ^= x << 17; | ||
x ^= x << 5; | ||
return x; | ||
} | ||
|
||
void Camera::getUUID128(uuid128_t *uuid) { | ||
uint32_t chip_id = (uint32_t)ESP.getEfuseMac(); | ||
for (size_t i = 0; i < UUID128_AS_32_LEN; i++) { | ||
chip_id = xorshift(chip_id); | ||
uuid->uint32[i] = chip_id; | ||
} | ||
} | ||
|
||
bool Camera::isConnected(void) { | ||
return m_Client->isConnected(); | ||
} | ||
|
||
} // namespace Furble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.