Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
egorguslyan
Dashboard
Commits
03e622b4
Commit
03e622b4
authored
3 years ago
by
egorguslyan
Browse files
Options
Downloads
Patches
Plain Diff
changeScreen, fixed strings, memset
parent
5ad8cc9a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dashboard/configScreens.h
+3
-2
3 additions, 2 deletions
Dashboard/configScreens.h
Dashboard/screens.h
+11
-2
11 additions, 2 deletions
Dashboard/screens.h
Dashboard/strings.h
+4
-4
4 additions, 4 deletions
Dashboard/strings.h
Dashboard/textbox.h
+2
-2
2 additions, 2 deletions
Dashboard/textbox.h
with
20 additions
and
10 deletions
Dashboard/configScreens.h
+
3
−
2
View file @
03e622b4
#define startWith SCREEN_WELCOME
// Screens
// Welcome screen with greetings
/* Welcome screen with greetings
Swipe left when prompts to continue (nextScreeen0) */
void
welcome
(
Arg
*
arg
);
/
/
Main screen with clock and CO2 bar
/
*
Main screen with clock and CO2 bar
*/
void
dashboard
(
Arg
*
arg
);
// Links
...
...
This diff is collapsed.
Click to expand it.
Dashboard/screens.h
+
11
−
2
View file @
03e622b4
...
...
@@ -2,6 +2,8 @@
// Clear touch panel bools
void
unhandle
();
// Change screen
void
changeScreen
(
uint8_t
current
,
uint8_t
next
);
void
unhandle
()
{
...
...
@@ -10,6 +12,13 @@ void unhandle()
globalVars
.
swipeLeft
=
globalVars
.
swipeRight
=
0
;
}
void
changeScreen
(
uint8_t
current
,
uint8_t
next
)
{
uint8_t
ns
=
*
(
&
(
screens
[
current
].
nextScreen0
)
+
sizeof
(
uint8_t
)
*
next
);
if
(
ns
==
NONE
)
return
;
globalVars
.
currentScreen
=
ns
;
}
void
welcome
(
Arg
*
arg
)
{
const
uint16_t
delayMap
[]
=
{
0
,
50
,
0
,
99
};
...
...
@@ -25,7 +34,7 @@ void welcome(Arg *arg)
case
0
:
if
(
globalVars
.
panelOrientation
!=
PANEL_UNKNOWN
)
{
globalVars
.
currentScreen
=
screens
[
SCREEN_WELCOME
].
nextScreen0
;
changeScreen
(
SCREEN_WELCOME
,
0
)
;
break
;
}
counter
=
0
;
...
...
@@ -57,7 +66,7 @@ void welcome(Arg *arg)
break
;
case
3
:
if
(
tb
.
render
())
globalVars
.
timer
=
millis
();
if
(
globalVars
.
swipeLeft
)
globalVars
.
currentScreen
=
screens
[
SCREEN_WELCOME
].
nextScreen0
;
if
(
globalVars
.
swipeLeft
)
changeScreen
(
SCREEN_WELCOME
,
0
)
;
break
;
}
unhandle
();
...
...
This diff is collapsed.
Click to expand it.
Dashboard/strings.h
+
4
−
4
View file @
03e622b4
#ifdef LANG_RU_RU
#define LANGMASK(n) langmask[n]
const
char
hello
[]
PROGMEM
=
"Привет
"
;
const
char
start_prompt
[]
PROGMEM
=
"<- Свайпни влево
"
;
const
char
pomodoro
[]
PROGMEM
=
"Помидор
"
;
const
char
set_time
[]
PROGMEM
=
"Установи время
"
;
const
char
hello
[]
PROGMEM
=
"
Ghbdtn"
;
//
Привет
const
char
start_prompt
[]
PROGMEM
=
"<-
Cdfqgyb dktdj"
;
//
Свайпни влево
const
char
pomodoro
[]
PROGMEM
=
"
Gjvbljh"
;
//
Помидор
const
char
set_time
[]
PROGMEM
=
"
Ecnfyjdb dhtvz"
;
//
Установи время
// Need to make it PROGMEM
const
uint64_t
langmask
[]
=
{
0xFF
,
0x1FFF
,
0xFF
,
0xFFFF
};
#else
...
...
This diff is collapsed.
Click to expand it.
Dashboard/textbox.h
+
2
−
2
View file @
03e622b4
...
...
@@ -55,7 +55,7 @@ textbox::textbox(void)
mode
=
0
;
speed
=
0
;
delay
=
0
;
memset
(
text
,
NULL
,
64
*
sizeof
(
char
));
memset
(
text
,
'\0'
,
64
*
sizeof
(
char
));
langMask
=
0
;
// If 96th symbol is font_null there is no native language except for English
native
=
pgm_read_byte
(
font
[
96
])
!=
0
;
...
...
@@ -68,7 +68,7 @@ void textbox::setup(char _text[], uint64_t _langMask,
uint8_t
_reciprocal_speed
=
0
,
uint16_t
_delay
=
0
)
{
// Copy string
memset
(
text
,
NULL
,
64
*
sizeof
(
char
));
memset
(
text
,
'\0'
,
64
*
sizeof
(
char
));
strcpy
(
text
,
_text
);
// Calculating width
textlen
=
strlen
(
text
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment