diff --git a/data/tile_map.ods b/data/tile_map.ods index dd0806c..36d990d 100644 Binary files a/data/tile_map.ods and b/data/tile_map.ods differ diff --git a/src/config.h b/src/config.h index b3c6623..fb5d07c 100644 --- a/src/config.h +++ b/src/config.h @@ -1,3 +1,26 @@ +/**************************************************************************** + config.h + + Tu May 22 21:23:51 2020 + Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _CONFIG_H #define _CONFIG_H @@ -8,6 +31,6 @@ /* * firmeware version string */ - #define __FIRMWARE__ "2020072202" + #define __FIRMWARE__ "2020072203" #endif // _CONFIG_H diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 189a910..3b29b58 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include diff --git a/src/gui/gui.h b/src/gui/gui.h index 8680a66..92cff30 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _GUI_H #define _GUI_H diff --git a/src/gui/keyboard.cpp b/src/gui/keyboard.cpp index 79aebd0..cb4df52 100644 --- a/src/gui/keyboard.cpp +++ b/src/gui/keyboard.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "keyboard.h" @@ -10,9 +31,9 @@ void keyboard_setup( void ) { return; kb = lv_keyboard_create( lv_scr_act() , NULL); - lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2 ); -// lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 3); -// lv_obj_align( kb, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, 0 ); +// lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2 ); + lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 3); + lv_obj_align( kb, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, 0 ); lv_keyboard_set_cursor_manage(kb, true); lv_obj_set_event_cb( kb, kb_event_cb ); lv_obj_set_hidden( kb, true ); diff --git a/src/gui/keyboard.h b/src/gui/keyboard.h index 993f5e8..afa65f6 100644 --- a/src/gui/keyboard.h +++ b/src/gui/keyboard.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _KEYBOARD_H #define _KEYBOARD_H diff --git a/src/gui/mainbar/app_tile/app_tile.cpp b/src/gui/mainbar/app_tile/app_tile.cpp index 0c02f4c..bd56e92 100644 --- a/src/gui/mainbar/app_tile/app_tile.cpp +++ b/src/gui/mainbar/app_tile/app_tile.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "../mainbar.h" #include "app_tile.h" diff --git a/src/gui/mainbar/app_tile/app_tile.h b/src/gui/mainbar/app_tile/app_tile.h index 9943adc..90893a1 100644 --- a/src/gui/mainbar/app_tile/app_tile.h +++ b/src/gui/mainbar/app_tile/app_tile.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _APP_TILE_H #define _APP_TILE_H diff --git a/src/gui/mainbar/main_tile/main_tile.cpp b/src/gui/mainbar/main_tile/main_tile.cpp index 076f147..dcc83fa 100644 --- a/src/gui/mainbar/main_tile/main_tile.cpp +++ b/src/gui/mainbar/main_tile/main_tile.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include #include @@ -6,7 +27,6 @@ #include "main_tile.h" static lv_obj_t *main_cont = NULL; -static lv_obj_t *widget_cont = NULL; static lv_obj_t *clock_cont = NULL; static lv_obj_t *timelabel = NULL; static lv_obj_t *datelabel = NULL; @@ -82,7 +102,6 @@ lv_obj_t *main_tile_register_widget( void ) { lv_obj_align( clock_cont, main_cont, LV_ALIGN_IN_TOP_MID, 0, 0 ); lv_obj_align( widget_entry[ widget ].widget , main_cont, LV_ALIGN_IN_BOTTOM_MID, 0, -32 ); lv_obj_set_hidden( widget_entry[ widget ].widget, false ); - Serial.printf("register widget on main tile\r\n" ); return( widget_entry[ widget ].widget ); } } diff --git a/src/gui/mainbar/main_tile/main_tile.h b/src/gui/mainbar/main_tile/main_tile.h index 3a45c46..3c7c8ae 100644 --- a/src/gui/mainbar/main_tile/main_tile.h +++ b/src/gui/mainbar/main_tile/main_tile.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _MAIL_TILE_H #define _MAIL_TILE_H diff --git a/src/gui/mainbar/mainbar.cpp b/src/gui/mainbar/mainbar.cpp index 81275cd..64cc8fb 100644 --- a/src/gui/mainbar/mainbar.cpp +++ b/src/gui/mainbar/mainbar.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include #include "config.h" @@ -6,6 +27,7 @@ #include "setup_tile/setup.h" #include "note_tile/note_tile.h" #include "app_tile/app_tile.h" +#include "gui/keyboard.h" #include "setup_tile/battery_settings/battery_settings.h" #include "setup_tile/wlan_settings/wlan_settings.h" @@ -23,6 +45,7 @@ lv_tile_entry_t tile_entry[ TILE_NUM ] { { NULL, TILE_TYPE_MAIN_TILE, MAIN_TILE, main_tile_setup, { 0 , 0 } }, { NULL, TILE_TYPE_APP_TILE, APP_TILE, app_tile_setup, { 1 , 0 } }, { NULL, TILE_TYPE_NOTE_TILE, NOTE_TILE, note_tile_setup, { 0 , 1 } }, + { NULL, TILE_TYPE_KEYBOARD_TILE, KEYBOARD_TILE, NULL, { 0 , 6 } }, { NULL, TILE_TYPE_SETUP_TILE, SETUP_TILE, setup_tile_setup, { 1 , 1 } }, { NULL, TILE_TYPE_SETUP, WLAN_SETTINGS_TILE, wlan_settings_tile_setup, { 0,3 } }, { NULL, TILE_TYPE_SETUP, WLAN_PASSWORD_TILE, wlan_password_tile_setup, { 0,4 } }, diff --git a/src/gui/mainbar/mainbar.h b/src/gui/mainbar/mainbar.h index 277cf49..0655a9c 100644 --- a/src/gui/mainbar/mainbar.h +++ b/src/gui/mainbar/mainbar.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _MAINBAR_H #define _MAINBAR_H @@ -9,6 +30,7 @@ TILE_TYPE_MAIN_TILE, TILE_TYPE_APP_TILE, TILE_TYPE_NOTE_TILE, + TILE_TYPE_KEYBOARD_TILE, TILE_TYPE_SETUP_TILE, TILE_TYPE_SETUP, TILE_TYPE_WIDGET_TILE, @@ -22,6 +44,7 @@ SETUP_TILE, NOTE_TILE, APP_TILE, + KEYBOARD_TILE, WLAN_SETTINGS_TILE, WLAN_PASSWORD_TILE, MOVE_SETTINGS_TILE, diff --git a/src/gui/mainbar/note_tile/note_tile.cpp b/src/gui/mainbar/note_tile/note_tile.cpp index 7a9aa22..4ac5967 100644 --- a/src/gui/mainbar/note_tile/note_tile.cpp +++ b/src/gui/mainbar/note_tile/note_tile.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "../mainbar.h" #include "note_tile.h" diff --git a/src/gui/mainbar/note_tile/note_tile.h b/src/gui/mainbar/note_tile/note_tile.h index ed6d9ac..a0af9e8 100644 --- a/src/gui/mainbar/note_tile/note_tile.h +++ b/src/gui/mainbar/note_tile/note_tile.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _NOTE_TILE_H #define _NOTE_TILE_H diff --git a/src/gui/mainbar/setup_tile/battery_settings/battery_settings.cpp b/src/gui/mainbar/setup_tile/battery_settings/battery_settings.cpp index d01f3fe..362c2b6 100644 --- a/src/gui/mainbar/setup_tile/battery_settings/battery_settings.cpp +++ b/src/gui/mainbar/setup_tile/battery_settings/battery_settings.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include "battery_settings.h" diff --git a/src/gui/mainbar/setup_tile/battery_settings/battery_settings.h b/src/gui/mainbar/setup_tile/battery_settings/battery_settings.h index c05caac..f3259a6 100644 --- a/src/gui/mainbar/setup_tile/battery_settings/battery_settings.h +++ b/src/gui/mainbar/setup_tile/battery_settings/battery_settings.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _BATTERY_SETTINGS_H #define _BATTERY_SETTINGS_H diff --git a/src/gui/mainbar/setup_tile/display_settings/display_setting.cpp b/src/gui/mainbar/setup_tile/display_settings/display_setting.cpp index 8a97daf..21f786e 100644 --- a/src/gui/mainbar/setup_tile/display_settings/display_setting.cpp +++ b/src/gui/mainbar/setup_tile/display_settings/display_setting.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "display_settings.h" diff --git a/src/gui/mainbar/setup_tile/display_settings/display_settings.h b/src/gui/mainbar/setup_tile/display_settings/display_settings.h index c5dab3c..f574c01 100644 --- a/src/gui/mainbar/setup_tile/display_settings/display_settings.h +++ b/src/gui/mainbar/setup_tile/display_settings/display_settings.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _DISPLAY_SETTINGS_H #define _DISPLAY_SETTINGS_H diff --git a/src/gui/mainbar/setup_tile/move_settings/move_settings.cpp b/src/gui/mainbar/setup_tile/move_settings/move_settings.cpp index e34459f..7ab0984 100644 --- a/src/gui/mainbar/setup_tile/move_settings/move_settings.cpp +++ b/src/gui/mainbar/setup_tile/move_settings/move_settings.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "move_settings.h" diff --git a/src/gui/mainbar/setup_tile/move_settings/move_settings.h b/src/gui/mainbar/setup_tile/move_settings/move_settings.h index ed0ea50..219d135 100644 --- a/src/gui/mainbar/setup_tile/move_settings/move_settings.h +++ b/src/gui/mainbar/setup_tile/move_settings/move_settings.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _MOVE_SETTINGS_H #define _MOVE_SETTINGS_H diff --git a/src/gui/mainbar/setup_tile/setup.cpp b/src/gui/mainbar/setup_tile/setup.cpp index 2302cd4..d39df49 100644 --- a/src/gui/mainbar/setup_tile/setup.cpp +++ b/src/gui/mainbar/setup_tile/setup.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "setup.h" diff --git a/src/gui/mainbar/setup_tile/setup.h b/src/gui/mainbar/setup_tile/setup.h index 4f4d7cf..98e8ef2 100644 --- a/src/gui/mainbar/setup_tile/setup.h +++ b/src/gui/mainbar/setup_tile/setup.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _SETUP_H #define _SETUP_H diff --git a/src/gui/mainbar/setup_tile/time_settings/time_settings.cpp b/src/gui/mainbar/setup_tile/time_settings/time_settings.cpp index 6e632b9..1ccb771 100644 --- a/src/gui/mainbar/setup_tile/time_settings/time_settings.cpp +++ b/src/gui/mainbar/setup_tile/time_settings/time_settings.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "time_settings.h" #include diff --git a/src/gui/mainbar/setup_tile/time_settings/time_settings.h b/src/gui/mainbar/setup_tile/time_settings/time_settings.h index 438c155..a26c804 100644 --- a/src/gui/mainbar/setup_tile/time_settings/time_settings.h +++ b/src/gui/mainbar/setup_tile/time_settings/time_settings.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _TIME_SETTINGS_H #define _TIME_SETTINGS_H diff --git a/src/gui/mainbar/setup_tile/update/update.cpp b/src/gui/mainbar/setup_tile/update/update.cpp index 04a68ee..3e04a65 100644 --- a/src/gui/mainbar/setup_tile/update/update.cpp +++ b/src/gui/mainbar/setup_tile/update/update.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include diff --git a/src/gui/mainbar/setup_tile/update/update.h b/src/gui/mainbar/setup_tile/update/update.h index 49503c4..e690b57 100644 --- a/src/gui/mainbar/setup_tile/update/update.h +++ b/src/gui/mainbar/setup_tile/update/update.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _UPDATE_H #define _UPDATE_H diff --git a/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.cpp b/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.cpp index 25b6cee..2a44583 100644 --- a/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.cpp +++ b/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "wlan_settings.h" diff --git a/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.h b/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.h index 1a67408..ba2a9da 100644 --- a/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.h +++ b/src/gui/mainbar/setup_tile/wlan_settings/wlan_settings.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _WLAN_SETTINGS_H #define _WLAN_SETTINGS_H diff --git a/src/gui/screenshot.cpp b/src/gui/screenshot.cpp index 0e68e98..6ded53c 100644 --- a/src/gui/screenshot.cpp +++ b/src/gui/screenshot.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "screenshot.h" diff --git a/src/gui/screenshot.h b/src/gui/screenshot.h index 4ce5372..ff84de8 100644 --- a/src/gui/screenshot.h +++ b/src/gui/screenshot.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _SCREENSHOT_H #define _SCREENSHOT_H diff --git a/src/gui/splashscreen.cpp b/src/gui/splashscreen.cpp index a96228e..3fb2280 100644 --- a/src/gui/splashscreen.cpp +++ b/src/gui/splashscreen.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "hardware/display.h" diff --git a/src/gui/splashscreen.h b/src/gui/splashscreen.h index 4648225..3e25169 100644 --- a/src/gui/splashscreen.h +++ b/src/gui/splashscreen.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _SPLASHSCREEN_H #define _SPLASHSCREEN_H diff --git a/src/gui/statusbar.cpp b/src/gui/statusbar.cpp index 0caca06..deba7df 100644 --- a/src/gui/statusbar.cpp +++ b/src/gui/statusbar.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include diff --git a/src/gui/statusbar.h b/src/gui/statusbar.h index f85552a..f26741a 100644 --- a/src/gui/statusbar.h +++ b/src/gui/statusbar.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _STATUSBAR_H #define _STATUSBAR_H diff --git a/src/gui/widget/weather/weather.cpp b/src/gui/widget/weather/weather.cpp index 7e512fb..3809f3b 100644 --- a/src/gui/widget/weather/weather.cpp +++ b/src/gui/widget/weather/weather.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include "weather.h" @@ -5,6 +26,9 @@ #include "gui/mainbar/mainbar.h" #include "gui/mainbar/main_tile/main_tile.h" #include "gui/statusbar.h" +#include "gui/keyboard.h" + +weather_config_t weather_config; lv_tile_number weather_widget_tile_num = NO_TILE; lv_tile_number weather_widget_setup_tile_num = NO_TILE; @@ -17,6 +41,9 @@ LV_IMG_DECLARE(weather_48px); LV_FONT_DECLARE(Ubuntu_16px); void weather_widget_setup( void ) { + + weather_load_config(); + // get a free widget tile and a widget setup tile weather_widget_tile_num = mainbar_get_next_free_tile( TILE_TYPE_WIDGET_TILE ); weather_widget_setup_tile_num = mainbar_get_next_free_tile( TILE_TYPE_WIDGET_SETUP ); @@ -54,14 +81,17 @@ static void enter_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ) { * */ lv_obj_t *weather_widget_setup_tile = NULL; +lv_obj_t *weather_apikey_textfield = NULL; +lv_obj_t *weather_lat_textfield = NULL; +lv_obj_t *weather_lon_textfield = NULL; lv_style_t weather_widget_setup_style; LV_IMG_DECLARE(exit_32px); +static void weather_apikey_event_cb( lv_obj_t * obj, lv_event_t event ); static void exit_weather_widget_setup_event_cb( lv_obj_t * obj, lv_event_t event ); void weather_widget_setup_tile_setup( lv_obj_t *tile, lv_style_t *style, lv_coord_t hres, lv_coord_t vres ) { - Serial.printf("setup widget setup tile\r\n"); lv_style_init( &weather_widget_setup_style ); lv_style_set_radius( &weather_widget_setup_style, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color( &weather_widget_setup_style, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); @@ -89,12 +119,72 @@ void weather_widget_setup_tile_setup( lv_obj_t *tile, lv_style_t *style, lv_coor lv_label_set_text( exit_label, "exit weather setup"); lv_obj_align( exit_label, exit_btn, LV_ALIGN_OUT_RIGHT_MID, 5, 0 ); + lv_obj_t *weather_apikey_cont = lv_obj_create( weather_widget_setup_tile, NULL ); + lv_obj_set_size(weather_apikey_cont, hres , 40); + lv_obj_add_style( weather_apikey_cont, LV_OBJ_PART_MAIN, style ); + lv_obj_align( weather_apikey_cont, weather_widget_setup_tile, LV_ALIGN_IN_TOP_RIGHT, 0, 75 ); + lv_obj_t *weather_apikey_label = lv_label_create( weather_apikey_cont, NULL); + lv_obj_add_style( weather_apikey_label, LV_OBJ_PART_MAIN, style ); + lv_label_set_text( weather_apikey_label, "key"); + lv_obj_align( weather_apikey_label, weather_apikey_cont, LV_ALIGN_IN_LEFT_MID, 5, 0 ); + weather_apikey_textfield = lv_textarea_create( weather_apikey_cont, NULL); + lv_textarea_set_text( weather_apikey_textfield, weather_config.apikey ); + lv_textarea_set_pwd_mode( weather_apikey_textfield, false); + lv_textarea_set_one_line( weather_apikey_textfield, true); + lv_textarea_set_cursor_hidden( weather_apikey_textfield, true); + lv_obj_set_width( weather_apikey_textfield, LV_HOR_RES /4 * 3 ); + lv_obj_align( weather_apikey_textfield, weather_apikey_cont, LV_ALIGN_IN_RIGHT_MID, -5, 0 ); + lv_obj_set_event_cb( weather_apikey_textfield, weather_apikey_event_cb ); + lv_obj_t *weather_lat_cont = lv_obj_create( weather_widget_setup_tile, NULL ); + lv_obj_set_size(weather_lat_cont, hres / 2 , 40 ); + lv_obj_add_style( weather_lat_cont, LV_OBJ_PART_MAIN, style ); + lv_obj_align( weather_lat_cont, weather_apikey_cont, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0 ); + lv_obj_t *weather_lat_label = lv_label_create( weather_lat_cont, NULL); + lv_obj_add_style( weather_lat_label, LV_OBJ_PART_MAIN, style ); + lv_label_set_text( weather_lat_label, "lat"); + lv_obj_align( weather_lat_label, weather_lat_cont, LV_ALIGN_IN_LEFT_MID, 5, 0 ); + weather_lat_textfield = lv_textarea_create( weather_lat_cont, NULL); + lv_textarea_set_text( weather_lat_textfield, weather_config.lat ); + lv_textarea_set_pwd_mode( weather_lat_textfield, false); + lv_textarea_set_one_line( weather_lat_textfield, true); + lv_textarea_set_cursor_hidden( weather_lat_textfield, true); + lv_obj_set_width( weather_lat_textfield, LV_HOR_RES / 4 ); + lv_obj_align( weather_lat_textfield, weather_lat_cont, LV_ALIGN_IN_RIGHT_MID, -5, 0 ); + lv_obj_set_event_cb( weather_lat_textfield, weather_apikey_event_cb ); + + lv_obj_t *weather_lon_cont = lv_obj_create( weather_widget_setup_tile, NULL ); + lv_obj_set_size(weather_lon_cont, hres / 2 , 40 ); + lv_obj_add_style( weather_lon_cont, LV_OBJ_PART_MAIN, style ); + lv_obj_align( weather_lon_cont, weather_apikey_cont, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, 0 ); + lv_obj_t *weather_lon_label = lv_label_create( weather_lon_cont, NULL); + lv_obj_add_style( weather_lon_label, LV_OBJ_PART_MAIN, style ); + lv_label_set_text( weather_lon_label, "lon"); + lv_obj_align( weather_lon_label, weather_lon_cont, LV_ALIGN_IN_LEFT_MID, 5, 0 ); + weather_lon_textfield = lv_textarea_create( weather_lon_cont, NULL); + lv_textarea_set_text( weather_lon_textfield, weather_config.lon ); + lv_textarea_set_pwd_mode( weather_lon_textfield, false); + lv_textarea_set_one_line( weather_lon_textfield, true); + lv_textarea_set_cursor_hidden( weather_lon_textfield, true); + lv_obj_set_width( weather_lon_textfield, LV_HOR_RES / 4 ); + lv_obj_align( weather_lon_textfield, weather_lon_cont, LV_ALIGN_IN_RIGHT_MID, -5, 0 ); + lv_obj_set_event_cb( weather_lon_textfield, weather_apikey_event_cb ); +} + +static void weather_apikey_event_cb( lv_obj_t * obj, lv_event_t event ) { + if( event == LV_EVENT_CLICKED ) { + keyboard_set_textarea( obj ); + } + else if ( event == LV_EVENT_DEFOCUSED ) { + keyboard_hide(); + } } static void exit_weather_widget_setup_event_cb( lv_obj_t * obj, lv_event_t event ) { switch( event ) { - case( LV_EVENT_CLICKED ): mainbar_jump_to_tilenumber( weather_widget_tile_num, LV_ANIM_ON ); + case( LV_EVENT_CLICKED ): keyboard_hide(); + weather_save_config(); + mainbar_jump_to_tilenumber( weather_widget_tile_num, LV_ANIM_ON ); break; } } @@ -113,7 +203,6 @@ static void exit_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ); static void setup_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ); void weather_widget_tile_setup( lv_obj_t *tile, lv_style_t *style, lv_coord_t hres, lv_coord_t vres ) { - Serial.printf("setup widget tile\r\n"); lv_obj_t * exit_btn = lv_imgbtn_create(tile, NULL); lv_imgbtn_set_src(exit_btn, LV_BTN_STATE_RELEASED, &exit_32px); lv_imgbtn_set_src(exit_btn, LV_BTN_STATE_PRESSED, &exit_32px); @@ -155,4 +244,46 @@ static void setup_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ) { case( LV_EVENT_CLICKED ): mainbar_jump_to_tilenumber( weather_widget_setup_tile_num, LV_ANIM_ON ); break; } +} + +/* + * + */ +void weather_save_config( void ) { + + strcpy( weather_config.apikey, lv_textarea_get_text( weather_apikey_textfield ) ); + strcpy( weather_config.lat, lv_textarea_get_text( weather_lat_textfield ) ); + strcpy( weather_config.lon, lv_textarea_get_text( weather_lon_textfield ) ); + + fs::File file = SPIFFS.open( WEATHER_CONFIG_FILE, FILE_WRITE ); + + if ( !file ) { + Serial.printf("Can't save file: %s\r\n", WEATHER_CONFIG_FILE ); + } + else { + file.write( (uint8_t *)&weather_config, sizeof( weather_config ) ); + file.close(); + } +} + +/* + * + */ +void weather_load_config( void ) { + + fs::File file = SPIFFS.open( WEATHER_CONFIG_FILE, FILE_READ ); + + if (!file) { + Serial.printf("Can't open file: %s\r\n", WEATHER_CONFIG_FILE ); + } + else { + int filesize = file.size(); + if ( filesize > sizeof( weather_config ) ) { + Serial.printf("Failed to read configfile. Wrong filesize!\r\n" ); + } + else { + file.read( (uint8_t *)&weather_config, filesize ); + } + file.close(); + } } \ No newline at end of file diff --git a/src/gui/widget/weather/weather.h b/src/gui/widget/weather/weather.h index d35c4e7..c742df3 100644 --- a/src/gui/widget/weather/weather.h +++ b/src/gui/widget/weather/weather.h @@ -1,12 +1,45 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _WEATHER_H #define _WEATHER_H #include + #define WEATHER_CONFIG_FILE "/weather.cfg" + + typedef struct { + char apikey[64]=""; + char lon[16]=""; + char lat[16]=""; + } weather_config_t; + void weather_widget_setup( void ); void weather_widget_tile_setup( lv_obj_t *tile, lv_style_t *style, lv_coord_t hres, lv_coord_t vres ); void weather_widget_setup_tile_setup( lv_obj_t *tile, lv_style_t *style, lv_coord_t hres, lv_coord_t vres ); + + void weather_save_config( void ); + + void weather_load_config( void ); #endif // _WEATHER_H diff --git a/src/hardware/bma.cpp b/src/hardware/bma.cpp index 4db0206..d4aea93 100644 --- a/src/hardware/bma.cpp +++ b/src/hardware/bma.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include diff --git a/src/hardware/bma.h b/src/hardware/bma.h index ff72580..a94b09d 100644 --- a/src/hardware/bma.h +++ b/src/hardware/bma.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _BMA_H #define _BMA_H diff --git a/src/hardware/display.cpp b/src/hardware/display.cpp index c055c5c..05116eb 100644 --- a/src/hardware/display.cpp +++ b/src/hardware/display.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include diff --git a/src/hardware/display.h b/src/hardware/display.h index 1f0a662..4a75611 100644 --- a/src/hardware/display.h +++ b/src/hardware/display.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _DISPLAY_H #define _DISPLAY_H diff --git a/src/hardware/motor.cpp b/src/hardware/motor.cpp index 4a8a364..06ba8cd 100644 --- a/src/hardware/motor.cpp +++ b/src/hardware/motor.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "motor.h" #include "powermgm.h" diff --git a/src/hardware/motor.h b/src/hardware/motor.h index 53b1cff..03b62a1 100644 --- a/src/hardware/motor.h +++ b/src/hardware/motor.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _MOTOR_H #define _MOTOR_H diff --git a/src/hardware/pmu.cpp b/src/hardware/pmu.cpp index 7869297..2f19e79 100644 --- a/src/hardware/pmu.cpp +++ b/src/hardware/pmu.cpp @@ -26,7 +26,7 @@ void pmu_setup( TTGOClass *ttgo ) { // enable coulumb counter if ( ttgo->power->EnableCoulombcounter() ) Serial.printf("enable coulumb counter failed!\r\n"); - if ( ttgo->power->setChargingTargetVoltage( AXP202_TARGET_VOL_4_2V ) ) + if ( ttgo->power->setChargingTargetVoltage( AXP202_TARGET_VOL_4_36V ) ) Serial.printf("target voltage set failed!\r\n"); if ( ttgo->power->setChargeControlCur( 300 ) ) Serial.printf("charge current set failed!\r\n"); diff --git a/src/hardware/pmu.h b/src/hardware/pmu.h index 9e1f970..904f9ba 100644 --- a/src/hardware/pmu.h +++ b/src/hardware/pmu.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _PMU_H #define _PMU_H diff --git a/src/hardware/powermgm.cpp b/src/hardware/powermgm.cpp index c8d7e84..8c28b75 100644 --- a/src/hardware/powermgm.cpp +++ b/src/hardware/powermgm.cpp @@ -1,7 +1,29 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include #include +#include #include "pmu.h" #include "bma.h" @@ -11,6 +33,8 @@ #include "motor.h" #include "touch.h" +#include "gui/mainbar/mainbar.h" + EventGroupHandle_t powermgm_status = NULL; /* @@ -40,8 +64,10 @@ void powermgm_loop( TTGOClass *ttgo ) { powermgm_clear_event( POWERMGM_STANDBY ); ttgo->openBL(); ttgo->displayWakeup(); + ttgo->bl->adjust( 0 ); ttgo->rtc->syncToSystem(); ttgo->startLvglTick(); + mainbar_jump_to_maintile( LV_ANIM_OFF ); lv_disp_trig_activity(NULL); if ( bma_get_config( BMA_STEPCOUNTER ) ) ttgo->bma->enableStepCountInterrupt( true ); diff --git a/src/hardware/powermgm.h b/src/hardware/powermgm.h index e044251..657508a 100644 --- a/src/hardware/powermgm.h +++ b/src/hardware/powermgm.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _POWERMGM_H #define _POWERMGM_H diff --git a/src/hardware/timesync.cpp b/src/hardware/timesync.cpp index d4c3fba..bf601ff 100644 --- a/src/hardware/timesync.cpp +++ b/src/hardware/timesync.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "timesync.h" #include @@ -92,8 +113,9 @@ void timesync_set_timezone( int32_t timezone ) { void timesync_Task( void * pvParameters ) { while( true ) { + vTaskDelay( 250 ); if ( xEventGroupGetBits( time_event_handle ) & TIME_SYNC_REQUEST ) { - struct tm timeinfo; + struct tm info; TTGOClass *ttgo = TTGOClass::getWatch(); long gmtOffset_sec = timesync_config.timezone * 3600; @@ -104,10 +126,11 @@ void timesync_Task( void * pvParameters ) { configTime( gmtOffset_sec, daylightOffset_sec, "pool.ntp.org" ); - if( !getLocalTime( &timeinfo ) ) { + if( !getLocalTime( &info ) ) { Serial.println( "Failed to obtain time\r\n" ); } ttgo->rtc->syncToRtc(); + xEventGroupClearBits( time_event_handle, TIME_SYNC_REQUEST ); } vTaskSuspend( _timesync_Task ); diff --git a/src/hardware/timesync.h b/src/hardware/timesync.h index bcf79f3..4ccfed0 100644 --- a/src/hardware/timesync.h +++ b/src/hardware/timesync.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _TIME_SYNC_H #define _TIME_SYNC_H diff --git a/src/hardware/touch.cpp b/src/hardware/touch.cpp index 3eaa598..89bc9d0 100644 --- a/src/hardware/touch.cpp +++ b/src/hardware/touch.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include "touch.h" diff --git a/src/hardware/touch.h b/src/hardware/touch.h index a998288..d0fd714 100644 --- a/src/hardware/touch.h +++ b/src/hardware/touch.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _TOUCH_H #define _TOUCH_H diff --git a/src/hardware/wifictl.cpp b/src/hardware/wifictl.cpp index 041f08b..58d8bc2 100644 --- a/src/hardware/wifictl.cpp +++ b/src/hardware/wifictl.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include #include @@ -187,7 +208,6 @@ bool wifictl_insert_network( const char *ssid, const char *password ) { // check for an emty entry for( int entry = 0 ; entry < NETWORKLIST_ENTRYS; entry++ ) { if( strlen( wifictl_networklist[ entry ].ssid ) == 0 ) { - Serial.printf("wifictl: insert network\r\n"); strncpy( wifictl_networklist[ entry ].ssid, ssid, sizeof( wifictl_networklist[ entry ].ssid ) ); strncpy( wifictl_networklist[ entry ].password, password, sizeof( wifictl_networklist[ entry ].password ) ); wifictl_save_network(); @@ -215,6 +235,7 @@ void wifictl_on( void ) { void wifictl_off( void ) { if ( wifi_init == false ) return; + vTaskResume( _wifictl_Task ); powermgm_set_event( POWERMGM_WIFI_OFF_REQUEST ); } @@ -227,23 +248,17 @@ void wifictl_Task( void * pvParameters ) { while( true ) { vTaskDelay( 50 ); - if ( powermgm_get_event( POWERMGM_STANDBY ) ) { - vTaskSuspend( _wifictl_Task ); + if ( powermgm_get_event( POWERMGM_WIFI_ON_REQUEST ) ) { + statusbar_wifi_set_state( true, "activate" ); + WiFi.mode( WIFI_STA ); + powermgm_clear_event( POWERMGM_WIFI_OFF_REQUEST | POWERMGM_WIFI_ACTIVE | POWERMGM_WIFI_CONNECTED | POWERMGM_WIFI_SCAN | POWERMGM_WIFI_ON_REQUEST ); } - else { - if ( powermgm_get_event( POWERMGM_WIFI_ON_REQUEST ) ) { - Serial.printf("wlan on request\r\n"); - statusbar_wifi_set_state( true, "activate" ); - WiFi.mode( WIFI_STA ); - powermgm_clear_event( POWERMGM_WIFI_OFF_REQUEST | POWERMGM_WIFI_ACTIVE | POWERMGM_WIFI_CONNECTED | POWERMGM_WIFI_SCAN | POWERMGM_WIFI_ON_REQUEST ); - } - else if ( powermgm_get_event( POWERMGM_WIFI_OFF_REQUEST ) ) { - Serial.printf("wlan off request\r\n"); - statusbar_wifi_set_state( false, "" ); - WiFi.mode( WIFI_OFF ); - esp_wifi_stop(); - powermgm_clear_event( POWERMGM_WIFI_OFF_REQUEST | POWERMGM_WIFI_ACTIVE | POWERMGM_WIFI_CONNECTED | POWERMGM_WIFI_SCAN | POWERMGM_WIFI_ON_REQUEST ); - } + else if ( powermgm_get_event( POWERMGM_WIFI_OFF_REQUEST ) ) { + statusbar_wifi_set_state( false, "" ); + WiFi.mode( WIFI_OFF ); + esp_wifi_stop(); + powermgm_clear_event( POWERMGM_WIFI_OFF_REQUEST | POWERMGM_WIFI_ACTIVE | POWERMGM_WIFI_CONNECTED | POWERMGM_WIFI_SCAN | POWERMGM_WIFI_ON_REQUEST ); } + vTaskSuspend( _wifictl_Task ); } } \ No newline at end of file diff --git a/src/hardware/wifictl.h b/src/hardware/wifictl.h index 8ed817a..1790a3c 100644 --- a/src/hardware/wifictl.h +++ b/src/hardware/wifictl.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifndef _WIFICTL_H #define _WIFICTL_H diff --git a/src/my-ttgo-watch.ino b/src/my-ttgo-watch.ino index ce6031c..394bb8d 100644 --- a/src/my-ttgo-watch.ino +++ b/src/my-ttgo-watch.ino @@ -1,11 +1,26 @@ +/**************************************************************************** + my-ttgo-watch.ino + + Tu May 22 21:23:51 2020 + Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + /* -Copyright (c) 2019 lewis he -This is just a demonstration. Most of the functions are not implemented. -The main implementation is low-power standby. -The off-screen standby (not deep sleep) current is about 4mA. -Select standard motherboard and standard backplane for testing. -Created by Lewis he on October 10, 2019. -*/ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "config.h" #include diff --git a/src/webserver/webserver.cpp b/src/webserver/webserver.cpp index 8c8d865..e867362 100644 --- a/src/webserver/webserver.cpp +++ b/src/webserver/webserver.cpp @@ -1,3 +1,24 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include #include diff --git a/src/webserver/webserver.h b/src/webserver/webserver.h index 6680170..3c92434 100644 --- a/src/webserver/webserver.h +++ b/src/webserver/webserver.h @@ -1,3 +1,25 @@ +/**************************************************************************** + * Tu May 22 21:23:51 2020 + * Copyright 2020 Dirk Brosswick + * Email: dirk.brosswick@googlemail.com + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + #ifndef _ASYNCWEBSERVER_H #define _ASYNCWEBSERVER_H diff --git a/ttgo-t-watch2020_v1.ino.bin b/ttgo-t-watch2020_v1.ino.bin index aef23ed..faccdcd 100644 Binary files a/ttgo-t-watch2020_v1.ino.bin and b/ttgo-t-watch2020_v1.ino.bin differ diff --git a/ttgo-t-watch2020_v1.version.txt b/ttgo-t-watch2020_v1.version.txt index 6067626..c532714 100644 --- a/ttgo-t-watch2020_v1.version.txt +++ b/ttgo-t-watch2020_v1.version.txt @@ -1 +1 @@ -2020072202 +2020072203