- WiFi Connect app is now hidden by default, but accessible at the bottom of the WiFi Manage app when WiFi is turned on. - WiFi service now turns on WiFi when calling connect() and WiFi is not on. - Removed `blocking` option for `service::loader::startApp()`. This feature was unused and complex. - Various apps: Moved private headers into Private/ folder. - Various apps: created start() function for easy starting. - Added documentation to all TactilityC APIs - Refactored various `enum` into `class enum` - Refactor M5Stack `initBoot()` (but VBus is still 0V for some reason)
35 lines
943 B
C++
35 lines
943 B
C++
#include "app/i2cscanner/I2cHelpers.h"
|
|
#include "Tactility.h"
|
|
#include "StringUtils.h"
|
|
#include <iomanip>
|
|
#include <vector>
|
|
#include <sstream>
|
|
|
|
namespace tt::app::i2cscanner {
|
|
|
|
std::string getAddressText(uint8_t address) {
|
|
std::stringstream stream;
|
|
stream << "0x"
|
|
<< std::uppercase << std::setfill ('0')
|
|
<< std::setw(2) << std::hex << (uint32_t)address;
|
|
return stream.str();
|
|
}
|
|
|
|
std::string getPortNamesForDropdown() {
|
|
std::vector<std::string> config_names;
|
|
size_t port_index = 0;
|
|
for (const auto& i2c_config: tt::getConfiguration()->hardware->i2c) {
|
|
if (!i2c_config.name.empty()) {
|
|
config_names.push_back(i2c_config.name);
|
|
} else {
|
|
std::stringstream stream;
|
|
stream << "Port " << std::to_string(port_index);
|
|
config_names.push_back(stream.str());
|
|
}
|
|
port_index++;
|
|
}
|
|
return string::join(config_names, "\n");
|
|
}
|
|
|
|
}
|