some updates and copy memo

This commit is contained in:
sharandac
2020-07-22 22:49:06 +02:00
parent e2a1bf107c
commit 8c99ffb741
57 changed files with 1272 additions and 37 deletions

Binary file not shown.

View File

@@ -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

View File

@@ -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 <stdio.h>
#include <TTGO.h>

View File

@@ -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

View File

@@ -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 );

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <stdio.h>
#include <time.h>
@@ -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 );
}
}

View File

@@ -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

View File

@@ -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 <stdio.h>
#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 } },

View File

@@ -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,

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <TTGO.h>
#include "battery_settings.h"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <WiFi.h>

View File

@@ -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

View File

@@ -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 <Arduino.h>
#include <WiFi.h>

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <stdio.h>

View File

@@ -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

View File

@@ -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 <TTGO.h>
#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();
}
}

View File

@@ -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 <TTGO.h>
#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

View File

@@ -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 <TTGO.h>
#include <soc/rtc.h>

View File

@@ -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

View File

@@ -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 <TTGO.h>

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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");

View File

@@ -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

View File

@@ -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 <TTGO.h>
#include <soc/rtc.h>
#include <WiFi.h>
#include <esp_wifi.h>
#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 );

View File

@@ -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

View File

@@ -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 <WiFi.h>
@@ -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 );

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <Arduino.h>
#include <WiFi.h>
@@ -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 );
}
}

View File

@@ -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

View File

@@ -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 <Arduino.h>

View File

@@ -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 <WiFi.h>
#include <WiFiClient.h>

View File

@@ -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

Binary file not shown.

View File

@@ -1 +1 @@
2020072202
2020072203