1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Björn Stenberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 #include "backlight.h"
32 #include "mp3_playback.h"
41 #include "powermgmt.h"
50 #include "statusbar.h"
51 #include "screen_access.h"
59 #if CONFIG_CODEC == SWCODEC
63 #if (CONFIG_STORAGE & STORAGE_MMC)
64 int mmc_remove_request(void)
66 struct queue_event ev
;
69 screens
[i
].clear_display();
70 splash(0, ID2P(LANG_REMOVE_MMC
));
74 queue_wait_w_tmo(&button_queue
, &ev
, HZ
/2);
77 case SYS_HOTSWAP_EXTRACTED
:
78 return SYS_HOTSWAP_EXTRACTED
;
80 case SYS_USB_DISCONNECTED
:
81 return SYS_USB_DISCONNECTED
;
87 /* the charging screen is only used for archos targets */
88 #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) && defined(CPU_SH)
90 #ifdef HAVE_LCD_BITMAP
91 static void charging_display_info(bool animate
)
93 unsigned char charging_logo
[36];
94 const int pox_x
= (LCD_WIDTH
- sizeof(charging_logo
)) / 2;
96 static unsigned phase
= 3;
99 #ifdef NEED_ATA_POWER_BATT_MEASURE
100 if (ide_powered()) /* FM and V2 can only measure when ATA power is on */
103 int battv
= battery_voltage();
104 lcd_putsf(0, 7, " Batt: %d.%02dV %d%% ", battv
/ 1000,
105 (battv
% 1000) / 10, battery_level());
108 #ifdef ARCHOS_RECORDER
109 lcd_puts(0, 2, "Charge mode:");
112 if (charge_state
== CHARGING
)
113 s
= str(LANG_BATTERY_CHARGE
);
114 else if (charge_state
== TOPOFF
)
115 s
= str(LANG_BATTERY_TOPOFF_CHARGE
);
116 else if (charge_state
== TRICKLE
)
117 s
= str(LANG_BATTERY_TRICKLE_CHARGE
);
122 if (!charger_enabled())
124 #endif /* ARCHOS_RECORDER */
127 memset(charging_logo
+3, 0x00, 32);
128 charging_logo
[0] = 0x3C;
129 charging_logo
[1] = 0x24;
130 charging_logo
[2] = charging_logo
[35] = 0xFF;
133 { /* draw the outline */
135 lcd_mono_bitmap(charging_logo
, pox_x
, pox_y
+ 8,
136 sizeof(charging_logo
), 8);
137 lcd_set_drawmode(DRMODE_FG
);
139 charging_logo
[0] = charging_logo
[1] = 0x00;
140 memset(charging_logo
+2, 0x80, 34);
141 lcd_mono_bitmap(charging_logo
, pox_x
, pox_y
, sizeof(charging_logo
), 8);
143 memset(charging_logo
+2, 0x01, 34);
144 lcd_mono_bitmap(charging_logo
, pox_x
, pox_y
+ 16,
145 sizeof(charging_logo
), 8);
146 lcd_set_drawmode(DRMODE_SOLID
);
149 { /* animate the middle part */
150 for (i
= 3; i
<MIN(sizeof(charging_logo
)-1, phase
); i
++)
152 if ((i
-phase
) % 8 == 0)
153 { /* draw a "bubble" here */
155 bitpos
= (phase
+ i
/8) % 15; /* "bounce" effect */
157 bitpos
= 14 - bitpos
;
158 charging_logo
[i
] = BIT_N(bitpos
);
161 lcd_mono_bitmap(charging_logo
, pox_x
, pox_y
+ 8,
162 sizeof(charging_logo
), 8);
167 #else /* not HAVE_LCD_BITMAP */
169 static unsigned long logo_chars
[4];
170 static const unsigned char logo_pattern
[] = {
171 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */
172 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */
173 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */
174 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */
177 static void logo_lock_patterns(bool on
)
183 for (i
= 0; i
< 4; i
++)
184 logo_chars
[i
] = lcd_get_locked_pattern();
188 for (i
= 0; i
< 4; i
++)
189 lcd_unlock_pattern(logo_chars
[i
]);
193 static void charging_display_info(bool animate
)
197 static unsigned phase
= 3;
200 battv
= battery_voltage();
201 lcd_putsf(4, 1, " %d.%02dV", battv
/ 1000, (battv
% 1000) / 10);
203 memcpy(buf
, logo_pattern
, 32); /* copy logo patterns */
205 if (!animate
) /* build the screen */
207 lcd_double_height(false);
208 lcd_puts(0, 0, "[Charging]");
209 for (i
= 0; i
< 4; i
++)
210 lcd_putc(i
, 1, logo_chars
[i
]);
212 else /* animate the logo */
214 for (i
= 3; i
< MIN(19, phase
); i
++)
216 if ((i
- phase
) % 5 == 0)
217 { /* draw a "bubble" here */
218 ypos
= (phase
+ i
/5) % 9; /* "bounce" effect */
221 buf
[5 - ypos
+ 8 * (i
/5)] |= 0x10u
>> (i
%5);
227 for (i
= 0; i
< 4; i
++)
228 lcd_define_pattern(logo_chars
[i
], buf
+ 8 * i
);
232 #endif /* (not) HAVE_LCD_BITMAP */
234 /* blocks while charging, returns on event:
235 1 if charger cable was removed
236 2 if Off/Stop key was pressed
237 3 if On key was pressed
238 4 if USB was connected */
240 int charging_screen(void)
245 ide_power_enable(false); /* power down the disk, else would be spinning */
248 backlight_set_timeout(global_settings
.backlight_timeout
);
249 #ifdef HAVE_REMOTE_LCD
250 remote_backlight_set_timeout(global_settings
.remote_backlight_timeout
);
252 backlight_set_timeout_plugged(global_settings
.backlight_timeout_plugged
);
254 #ifdef HAVE_LCD_CHARCELLS
255 logo_lock_patterns(true);
257 charging_display_info(false);
261 gui_syncstatusbar_draw(&statusbars
, false);
262 charging_display_info(true);
263 button
= get_action(CONTEXT_STD
,HZ
/3);
264 if (button
== ACTION_STD_OK
)
266 else if (usb_detect() == USB_INSERTED
)
268 else if (!charger_inserted())
272 #ifdef HAVE_LCD_CHARCELLS
273 logo_lock_patterns(false);
277 #endif /* CONFIG_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING && defined(CPU_SH) */
280 void charging_splash(void)
282 splash(2*HZ
, str(LANG_BATTERY_CHARGE
));
283 button_clear_queue();
288 #if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
290 /* little helper function for voice output */
291 static void say_time(int cursorpos
, const struct tm
*tm
)
296 if (!global_settings
.talk_menu
)
314 value
= tm
->tm_year
+ 1900;
321 if (cursorpos
== 4) /* month */
322 talk_id(LANG_MONTH_JANUARY
+ tm
->tm_mon
, false);
324 talk_value(value
, unit
, false);
331 #define SEPARATOR ":"
334 #define IDX_MINUTES 1
335 #define IDX_SECONDS 2
341 #define OFF_MINUTES 3
342 #define OFF_SECONDS 6
346 bool set_time_screen(const char* title
, struct tm
*tm
)
348 struct viewport viewports
[NB_SCREENS
];
349 bool done
= false, usb
= false;
352 unsigned char offsets_ptr
[] =
353 { OFF_HOURS
, OFF_MINUTES
, OFF_SECONDS
, OFF_YEAR
, 0, OFF_DAY
};
357 offsets_ptr
[IDX_HOURS
] = OFF_SECONDS
;
358 offsets_ptr
[IDX_SECONDS
] = OFF_HOURS
;
359 offsets_ptr
[IDX_YEAR
] = OFF_DAY
;
360 offsets_ptr
[IDX_DAY
] = OFF_YEAR
;
363 /* speak selection when screen is entered */
364 say_time(cursorpos
, tm
);
366 #ifdef HAVE_TOUCHSCREEN
367 enum touchscreen_mode old_mode
= touchscreen_get_mode();
368 touchscreen_set_mode(TOUCHSCREEN_BUTTON
);
372 unsigned int i
, realyear
, min
, max
;
373 unsigned char *ptr
[6];
374 unsigned char buffer
[20];
376 static unsigned char daysinmonth
[] =
377 {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
379 /* for easy acess in the drawing loop */
380 for (i
= 0; i
< 6; i
++)
381 ptr
[i
] = buffer
+ offsets_ptr
[i
];
382 ptr
[IDX_MONTH
] = str(LANG_MONTH_JANUARY
+ tm
->tm_mon
); /* month name */
384 /* calculate the number of days in febuary */
385 realyear
= tm
->tm_year
+ 1900;
386 if((realyear
% 4 == 0 && !(realyear
% 100 == 0)) || realyear
% 400 == 0)
391 /* fix day if month or year changed */
392 if (tm
->tm_mday
> daysinmonth
[tm
->tm_mon
])
393 tm
->tm_mday
= daysinmonth
[tm
->tm_mon
];
395 /* calculate day of week */
398 /* put all the numbers we want from the tm struct into
399 an easily printable buffer */
400 snprintf(buffer
, sizeof(buffer
),
401 "%02d " "%02d " "%02d " "%04d " "%02d",
402 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
,
403 tm
->tm_year
+1900, tm
->tm_mday
);
405 /* convert spaces in the buffer to '\0' to make it possible to work
406 directly on the buffer */
407 for(i
=0; i
< sizeof(buffer
); i
++)
416 unsigned int separator_width
, weekday_width
;
417 unsigned int j
, width
, prev_line_height
;
418 /* 6 possible cursor possitions, 2 values stored for each: x, y */
419 unsigned int cursor
[6][2];
420 struct viewport
*vp
= &viewports
[s
];
421 struct screen
*screen
= &screens
[s
];
422 static unsigned char rtl_idx
[] =
423 { IDX_SECONDS
, IDX_MINUTES
, IDX_HOURS
, IDX_DAY
, IDX_MONTH
, IDX_YEAR
};
425 viewport_set_defaults(vp
, s
);
426 screen
->set_viewport(vp
);
427 nb_lines
= viewport_get_nb_lines(vp
);
429 /* minimum lines needed is 2 + title line */
432 vp
->font
= FONT_SYSFIXED
;
433 nb_lines
= viewport_get_nb_lines(vp
);
436 /* recalculate the positions and offsets */
438 screen
->getstringsize(title
, NULL
, &prev_line_height
);
440 prev_line_height
= 0;
442 screen
->getstringsize(SEPARATOR
, &separator_width
, NULL
);
445 screen
->getstringsize(str(LANG_WEEKDAY_SUNDAY
+ tm
->tm_wday
),
446 &weekday_width
, NULL
);
447 screen
->getstringsize(" ", &separator_width
, NULL
);
449 for(i
=0, j
=0; i
< 6; i
++)
451 if(i
==3) /* second row */
453 j
= weekday_width
+ separator_width
;
454 prev_line_height
*= 2;
456 screen
->getstringsize(ptr
[i
], &width
, NULL
);
457 cursor
[i
][INDEX_Y
] = prev_line_height
;
458 cursor
[i
][INDEX_X
] = j
;
459 j
+= width
+ separator_width
;
462 /* draw the screen */
463 screen
->set_viewport(vp
);
464 screen
->clear_viewport();
465 /* display the screen title */
466 screen
->puts_scroll(0, 0, title
);
468 /* these are not selectable, so we draw them outside the loop */
469 /* name of the week day */
470 screen
->putsxy(0, cursor
[3][INDEX_Y
],
471 str(LANG_WEEKDAY_SUNDAY
+ tm
->tm_wday
));
473 pos
= lang_is_rtl() ? rtl_idx
[cursorpos
] : cursorpos
;
474 /* draw the selected item with drawmode set to
475 DRMODE_SOLID|DRMODE_INVERSEVID, all other selectable
476 items with drawmode DRMODE_SOLID */
480 vp
->drawmode
= (DRMODE_SOLID
|DRMODE_INVERSEVID
);
482 screen
->putsxy(cursor
[i
][INDEX_X
],
483 cursor
[i
][INDEX_Y
], ptr
[i
]);
485 vp
->drawmode
= DRMODE_SOLID
;
487 screen
->putsxy(cursor
[i
/4 +1][INDEX_X
] - separator_width
,
488 cursor
[0][INDEX_Y
], SEPARATOR
);
491 /* print help text */
493 screen
->puts(0, 4, str(LANG_TIME_SET_BUTTON
));
495 screen
->puts(0, 5, str(LANG_TIME_REVERT
));
496 screen
->update_viewport();
497 screen
->set_viewport(NULL
);
500 /* set the most common numbers */
503 /* calculate the minimum and maximum for the number under cursor */
507 valptr
= &tm
->tm_hour
;
510 valptr
= &tm
->tm_min
;
513 valptr
= &tm
->tm_sec
;
518 valptr
= &tm
->tm_year
;
522 valptr
= &tm
->tm_mon
;
526 max
= daysinmonth
[tm
->tm_mon
];
527 valptr
= &tm
->tm_mday
;
531 button
= get_action(CONTEXT_SETTINGS_TIME
, TIMEOUT_BLOCK
);
533 case ACTION_STD_PREV
:
534 cursorpos
= clamp_value_wrap(--cursorpos
, 5, 0);
535 say_time(cursorpos
, tm
);
537 case ACTION_STD_NEXT
:
538 cursorpos
= clamp_value_wrap(++cursorpos
, 5, 0);
539 say_time(cursorpos
, tm
);
541 case ACTION_SETTINGS_INC
:
542 case ACTION_SETTINGS_INCREPEAT
:
543 *valptr
= clamp_value_wrap(++(*valptr
), max
, min
);
544 say_time(cursorpos
, tm
);
546 case ACTION_SETTINGS_DEC
:
547 case ACTION_SETTINGS_DECREPEAT
:
548 *valptr
= clamp_value_wrap(--(*valptr
), max
, min
);
549 say_time(cursorpos
, tm
);
556 case ACTION_STD_CANCEL
:
562 if (default_event_handler(button
) == SYS_USB_CONNECTED
)
568 screens
[s
].scroll_stop(&viewports
[s
]);
569 #ifdef HAVE_TOUCHSCREEN
570 touchscreen_set_mode(old_mode
);
574 #endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */
576 #if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
577 bool shutdown_screen(void)
581 long time_entered
= current_tick
;
585 splash(0, str(LANG_CONFIRM_SHUTDOWN
));
587 while(!done
&& TIME_BEFORE(current_tick
,time_entered
+HZ
*2))
589 button
= get_action(CONTEXT_STD
,HZ
);
592 case ACTION_STD_CANCEL
:
596 /* do nothing here, because ACTION_NONE might be caused
597 * by timeout or button release. In case of timeout the loop
598 * is terminated by TIME_BEFORE */
603 if(default_event_handler(button
) == SYS_USB_CONNECTED
)
613 static const int id3_headers
[]=
618 LANG_ID3_ALBUMARTIST
,
629 #if CONFIG_CODEC == SWCODEC
636 struct id3view_info
{
637 struct mp3entry
* id3
;
639 int info_id
[ARRAYLEN(id3_headers
)];
642 static const char* id3_get_info(int selected_item
, void* data
,
643 char *buffer
, size_t buffer_len
)
645 struct id3view_info
*info
= (struct id3view_info
*)data
;
646 struct mp3entry
* id3
=info
->id3
;
647 int info_no
=selected_item
/2;
648 if(!(selected_item
%2))
650 snprintf(buffer
, buffer_len
,
651 "[%s]", str(id3_headers
[info
->info_id
[info_no
]]));
658 switch(info
->info_id
[info_no
])
660 case 0:/*LANG_ID3_TITLE*/
663 case 1:/*LANG_ID3_ARTIST*/
666 case 2:/*LANG_ID3_ALBUM*/
669 case 3:/*LANG_ID3_ALBUMARTIST*/
670 val
=id3
->albumartist
;
672 case 4:/*LANG_ID3_GROUPING*/
675 case 5:/*LANG_ID3_DISCNUM*/
676 if (id3
->disc_string
)
677 val
= id3
->disc_string
;
678 else if (id3
->discnum
)
680 snprintf(buffer
, buffer_len
, "%d", id3
->discnum
);
684 case 6:/*LANG_ID3_TRACKNUM*/
685 if (id3
->track_string
)
686 val
= id3
->track_string
;
687 else if (id3
->tracknum
)
689 snprintf(buffer
, buffer_len
, "%d", id3
->tracknum
);
693 case 7:/*LANG_ID3_COMMENT*/
696 snprintf(buffer
, buffer_len
, "%s", id3
->comment
);
699 case 8:/*LANG_ID3_GENRE*/
700 val
= id3
->genre_string
;
702 case 9:/*LANG_ID3_YEAR*/
703 if (id3
->year_string
)
704 val
= id3
->year_string
;
707 snprintf(buffer
, buffer_len
, "%d", id3
->year
);
711 case 10:/*LANG_ID3_LENGTH*/
712 format_time(buffer
, buffer_len
, id3
->length
);
715 case 11:/*LANG_ID3_PLAYLIST*/
716 snprintf(buffer
, buffer_len
, "%d/%d",
717 playlist_get_display_index(), playlist_amount());
720 case 12:/*LANG_ID3_BITRATE*/
721 snprintf(buffer
, buffer_len
, "%d kbps%s", id3
->bitrate
,
722 id3
->vbr
? str(LANG_ID3_VBR
) : (const unsigned char*) "");
725 case 13:/*LANG_ID3_FREQUENCY*/
726 snprintf(buffer
, buffer_len
, "%ld Hz", id3
->frequency
);
729 #if CONFIG_CODEC == SWCODEC
730 case 14:/*LANG_ID3_TRACK_GAIN*/
731 val
=id3
->track_gain_string
;
733 case 15:/*LANG_ID3_ALBUM_GAIN*/
734 val
=id3
->album_gain_string
;
736 case 16:/*LANG_ID3_PATH*/
738 case 14:/*LANG_ID3_PATH*/
743 return val
&& *val
? val
: NULL
;
747 bool browse_id3(void)
749 struct gui_synclist id3_lists
;
750 struct mp3entry
* id3
= audio_current_track();
753 struct id3view_info info
;
756 for (i
= 0; i
< ARRAYLEN(id3_headers
); i
++)
760 if (id3_get_info((i
*2)+1, &info
, temp
, 8) != NULL
)
761 info
.info_id
[info
.count
++] = i
;
764 gui_synclist_init(&id3_lists
, &id3_get_info
, &info
, true, 2, NULL
);
765 gui_synclist_set_nb_items(&id3_lists
, info
.count
*2);
766 gui_synclist_draw(&id3_lists
);
768 key
= get_action(CONTEXT_LIST
,HZ
/2);
769 if(key
!=ACTION_NONE
&& key
!=ACTION_UNKNOWN
770 && !gui_synclist_do_button(&id3_lists
, &key
,LIST_WRAP_UNLESS_HELD
))
772 return(default_event_handler(key
) == SYS_USB_CONNECTED
);
777 static const char* runtime_get_data(int selected_item
, void* data
,
778 char* buffer
, size_t buffer_len
)
782 switch (selected_item
)
784 case 0: return str(LANG_RUNNING_TIME
);
785 case 1: t
= global_status
.runtime
; break;
786 case 2: return str(LANG_TOP_TIME
);
787 case 3: t
= global_status
.topruntime
; break;
792 snprintf(buffer
, buffer_len
, "%dh %dm %ds",
793 t
/ 3600, (t
% 3600) / 60, t
% 60);
797 static int runtime_speak_data(int selected_item
, void* data
)
801 (selected_item
< 2) ? LANG_RUNNING_TIME
: LANG_TOP_TIME
,
802 TALK_ID((selected_item
< 2) ? global_status
.runtime
803 : global_status
.topruntime
, UNIT_TIME
));
808 bool view_runtime(void)
810 static const char *lines
[]={ID2P(LANG_CLEAR_TIME
)};
811 static const struct text_message message
={lines
, 1};
813 struct gui_synclist lists
;
815 gui_synclist_init(&lists
, runtime_get_data
, NULL
, false, 2, NULL
);
816 #if !defined(HAVE_LCD_CHARCELLS)
817 gui_synclist_set_title(&lists
, str(LANG_RUNNING_TIME
), NOICON
);
819 gui_synclist_set_title(&lists
, NULL
, NOICON
);
821 if(global_settings
.talk_menu
)
822 gui_synclist_set_voice_callback(&lists
, runtime_speak_data
);
823 gui_synclist_set_icon_callback(&lists
, NULL
);
824 gui_synclist_set_nb_items(&lists
, 4);
825 gui_synclist_speak_item(&lists
);
828 global_status
.runtime
+= ((current_tick
- lasttime
) / HZ
);
830 lasttime
= current_tick
;
831 gui_synclist_draw(&lists
);
832 list_do_action(CONTEXT_STD
, HZ
,
833 &lists
, &action
, LIST_WRAP_UNLESS_HELD
);
834 if(action
== ACTION_STD_CANCEL
)
836 if(action
== ACTION_STD_OK
) {
837 if(gui_syncyesno_run(&message
, NULL
, NULL
)==YESNO_YES
)
839 if (!(gui_synclist_get_sel_pos(&lists
)/2))
840 global_status
.runtime
= 0;
842 global_status
.topruntime
= 0;
843 gui_synclist_speak_item(&lists
);
846 if(default_event_handler(action
) == SYS_USB_CONNECTED
)
852 #ifdef HAVE_TOUCHSCREEN
853 static int get_sample(struct touchscreen_calibration
*cal
, int x
, int y
, int i
,
854 struct screen
* screen
)
860 screen
->drawline(x
- 10, y
, x
- 2, y
);
861 screen
->drawline(x
+ 2, y
, x
+ 10, y
);
862 screen
->drawline(x
, y
- 10, x
, y
- 2);
863 screen
->drawline(x
, y
+ 2, x
, y
+ 10);
866 /* Wait for a touchscreen press */
869 action
= get_action(CONTEXT_STD
, TIMEOUT_BLOCK
);
870 if(action
== ACTION_TOUCHSCREEN
)
872 if(action_get_touchscreen_press(&ts_x
, &ts_y
) == BUTTON_REL
)
875 else if(action
== ACTION_STD_CANCEL
)
890 short points
[3][2] = {
891 {LCD_WIDTH
/10, LCD_HEIGHT
/10},
892 {7*LCD_WIDTH
/8, LCD_HEIGHT
/2},
893 {LCD_WIDTH
/2, 7*LCD_HEIGHT
/8}
895 struct screen
* screen
= &screens
[SCREEN_MAIN
];
896 enum touchscreen_mode old_mode
= touchscreen_get_mode();
897 struct touchscreen_calibration cal
;
900 /* hide the statusbar */
901 viewportmanager_theme_enable(SCREEN_MAIN
, false, NULL
);
903 touchscreen_disable_mapping(); /* set raw mode */
904 touchscreen_set_mode(TOUCHSCREEN_POINT
);
908 screen
->clear_display();
910 if(get_sample(&cal
, points
[i
][0], points
[i
][1], i
, screen
))
918 touchscreen_calibrate(&cal
);
920 touchscreen_reset_mapping();
922 memcpy(&global_settings
.ts_calibration_data
, &calibration_parameters
,
923 sizeof(struct touchscreen_parameter
));
925 touchscreen_set_mode(old_mode
);
926 viewportmanager_theme_undo(SCREEN_MAIN
, false);
932 int reset_mapping(void)
934 touchscreen_reset_mapping();
936 memcpy(&global_settings
.ts_calibration_data
, &calibration_parameters
,
937 sizeof(struct touchscreen_parameter
));