Skip to content

Commit

Permalink
some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sharandac committed Oct 7, 2020
1 parent 75a3001 commit e3126ca
Show file tree
Hide file tree
Showing 18 changed files with 1,687 additions and 222 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
deploy.sh
.gitignore
data/tile_map.ods
firmware_fork_list,json
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ For the weather app you need an openweather.com api-id. http://openweathermap.or

The bluetooth notification work with [gadgetbridge](https://gadgetbridge.org) very well. But keep in mind, bluetooth in standby reduces the battery runtime. In connection with [OsmAnd](https://osmand.net) the watch can also be used for navigation. Please use the osmand app, otherwise a lot of messages will be displayed.

# Forks that are recommended

[FantasyFactory](https://github.com/FantasyFactory/My-TTGO-Watch)<br>
[NorthernDIY](https://github.com/NorthernDIY/My-TTGO-Watch)<br>

# for the programmers

Internal RAM is very limited, use PSRAM as much as possible. When you work with ArduinoJson, include this
Expand Down
8 changes: 8 additions & 0 deletions src/app/osmand/osmand_app_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ struct direction_t direction[] = {
{ "droite et continuez", "franchement", &sharply_right_128px },
{ "gauche et continuez", "", &turn_left_128px },
{ "droite et continuez", "", &turn_right_128px },
// italian direction
{ "Avanti", "", &ahead_128px },
{ "sinistra", "leggermente", &slightly_left_128px },
{ "destra", "leggermente", &slightly_right_128px },
{ "sinistra", "bruscamente", &sharply_left_128px },
{ "destra", "bruscamente", &sharply_right_128px },
{ "gira a sinistra", "", &turn_left_128px },
{ "gira a destra", "", &turn_right_128px },
{ "", "", NULL }
};

Expand Down
2 changes: 1 addition & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
/*
* firmeware version string
*/
#define __FIRMWARE__ "2020100402"
#define __FIRMWARE__ "2020100701"

#endif // _CONFIG_H
290 changes: 290 additions & 0 deletions src/gui/images/next_64px.c

Large diffs are not rendered by default.

290 changes: 290 additions & 0 deletions src/gui/images/pause_64px.c

Large diffs are not rendered by default.

290 changes: 290 additions & 0 deletions src/gui/images/play_64px.c

Large diffs are not rendered by default.

290 changes: 290 additions & 0 deletions src/gui/images/prev_64px.c

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions src/gui/mainbar/setup_tile/bluetooth_settings/bluetooth_media.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/****************************************************************************
* Oct 05 23:05:42 2020
* Copyright 2020 Dirk Brosswick
* Email: [email protected]
****************************************************************************/

/*
* 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 "bluetooth_media.h"

#include "gui/mainbar/mainbar.h"
#include "gui/mainbar/setup_tile/setup_tile.h"
#include "gui/statusbar.h"
#include "gui/sound/piep.h"

#include "hardware/blectl.h"

lv_obj_t *bluetooth_media_tile = NULL;
lv_style_t bluetooth_media_style;
uint32_t bluetooth_media_tile_num;

lv_obj_t *bluetooth_media_play = NULL;
lv_obj_t *bluetooth_media_prev = NULL;
lv_obj_t *bluetooth_media_next = NULL;

LV_IMG_DECLARE(cancel_32px);
LV_FONT_DECLARE(Ubuntu_16px);
LV_FONT_DECLARE(Ubuntu_32px);

bool bluetooth_media_event_cb( EventBits_t event, void *arg );
static void exit_bluetooth_media_event_cb( lv_obj_t * obj, lv_event_t event );

void bluetooth_media_tile_setup( void ) {
// get an app tile and copy mainstyle
bluetooth_media_tile_num = mainbar_add_app_tile( 1, 1, "bluetooth media" );
bluetooth_media_tile = mainbar_get_tile_obj( bluetooth_media_tile_num );

lv_style_copy( &bluetooth_media_style, mainbar_get_style() );
lv_style_set_bg_color( &bluetooth_media_style, LV_OBJ_PART_MAIN, LV_COLOR_BLACK );
lv_style_set_bg_opa( &bluetooth_media_style, LV_OBJ_PART_MAIN, LV_OPA_100);
lv_style_set_border_width( &bluetooth_media_style, LV_OBJ_PART_MAIN, 0);
lv_style_set_text_font( &bluetooth_media_style, LV_STATE_DEFAULT, &Ubuntu_16px);
lv_obj_add_style( bluetooth_media_tile, LV_OBJ_PART_MAIN, &bluetooth_media_style );

lv_obj_t *exit_btn = lv_imgbtn_create( bluetooth_media_tile, NULL);
lv_imgbtn_set_src( exit_btn, LV_BTN_STATE_RELEASED, &cancel_32px);
lv_imgbtn_set_src( exit_btn, LV_BTN_STATE_PRESSED, &cancel_32px);
lv_imgbtn_set_src( exit_btn, LV_BTN_STATE_CHECKED_RELEASED, &cancel_32px);
lv_imgbtn_set_src( exit_btn, LV_BTN_STATE_CHECKED_PRESSED, &cancel_32px);
lv_obj_add_style( exit_btn, LV_IMGBTN_PART_MAIN, &bluetooth_media_style );
lv_obj_align( exit_btn, bluetooth_media_tile, LV_ALIGN_IN_TOP_RIGHT, -10, 10 );
lv_obj_set_event_cb( exit_btn, exit_bluetooth_media_event_cb );

blectl_register_cb( BLECTL_MSG, bluetooth_media_event_cb, "bluetooth media" );
}

static void exit_bluetooth_media_event_cb( lv_obj_t * obj, lv_event_t event ) {
switch( event ) {
case( LV_EVENT_CLICKED ): mainbar_jump_to_maintile( LV_ANIM_OFF );
break;
}
}

bool bluetooth_media_event_cb( EventBits_t event, void *arg ) {
switch( event ) {
case BLECTL_MSG:
break;
}
return( true );
}
29 changes: 29 additions & 0 deletions src/gui/mainbar/setup_tile/bluetooth_settings/bluetooth_media.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/****************************************************************************
* Oct 05 23:05:42 2020
* Copyright 2020 Dirk Brosswick
* Email: [email protected]
****************************************************************************/

/*
* 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 _BLUETOOTH_MEDIA_H
#define _BLUETOOTH_MEDIA_H

#include <TTGO.h>

void bluetooth_media_tile_setup( void );

#endif // _BLUETOOTH_MEDIA_H
Loading

0 comments on commit e3126ca

Please sign in to comment.