mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-06 02:42:21 +00:00
RDS Radiotext should make receiver happier (missing end char)
String-ized text entry
This commit is contained in:
@@ -24,17 +24,17 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
bool textentry(NavigationView& nav, char * str, const size_t max_length, const std::function<void(char *)> on_done) {
|
||||
bool text_entry(NavigationView& nav, std::string& str, const size_t max_length, const std::function<void(std::string)> on_done) {
|
||||
|
||||
if (portapack::persistent_memory::ui_config_textentry() == 0) {
|
||||
auto te_view = nav.push<AlphanumView>(str, max_length);
|
||||
te_view->on_changed = [str, max_length, on_done](char * value) {
|
||||
te_view->on_changed = [str, max_length, on_done](std::string value) {
|
||||
//memcpy(str, value, max_length + 1);
|
||||
if (on_done) on_done(value);
|
||||
};
|
||||
} else {
|
||||
auto te_view = nav.push<HandWriteView>(str, max_length);
|
||||
te_view->on_changed = [str, max_length, on_done](char * value) {
|
||||
te_view->on_changed = [str, max_length, on_done](std::string value) {
|
||||
//memcpy(str, value, max_length + 1);
|
||||
if (on_done) on_done(value);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user