diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-03-11 09:28:49 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-03-11 09:28:49 +0000 |
commit | 06bc627c993b742997473bd76c75795c4b165cae (patch) | |
tree | 9d41cbb602de3ae59942c0ffc091670ef2e659f7 | |
parent | 37f529cc3cdcc7990b2a770efec06e45c6054f36 (diff) | |
download | rockbox-06bc627c993b742997473bd76c75795c4b165cae.tar.gz rockbox-06bc627c993b742997473bd76c75795c4b165cae.zip |
Removed lcd_roll() and lcd_remote_roll() functions. These functions were not really portable. Removed the only plugin that used lcd_roll(): Oscillograph. Oscilloscope offers everything that oscillograph did and more, in a portable way. * Bumped & sorted plugin API.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8995 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugin.c | 25 | ||||
-rw-r--r-- | apps/plugin.h | 28 | ||||
-rw-r--r-- | apps/plugins/SOURCES | 1 | ||||
-rw-r--r-- | apps/plugins/oscillograph.c | 300 | ||||
-rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 26 | ||||
-rw-r--r-- | firmware/drivers/lcd-h100.c | 18 | ||||
-rw-r--r-- | firmware/drivers/lcd-h300.c | 13 | ||||
-rw-r--r-- | firmware/drivers/lcd-ipod.c | 26 | ||||
-rw-r--r-- | firmware/drivers/lcd-ipodvideo.c | 13 | ||||
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 12 |
10 files changed, 21 insertions, 441 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index ac1825180e..63097a2589 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -104,9 +104,6 @@ static const struct plugin_api rockbox_api = { | |||
104 | PREFIX(lcd_icon), | 104 | PREFIX(lcd_icon), |
105 | lcd_double_height, | 105 | lcd_double_height, |
106 | #else | 106 | #else |
107 | #ifndef SIMULATOR | ||
108 | lcd_roll, | ||
109 | #endif | ||
110 | lcd_set_drawmode, | 107 | lcd_set_drawmode, |
111 | lcd_get_drawmode, | 108 | lcd_get_drawmode, |
112 | lcd_setfont, | 109 | lcd_setfont, |
@@ -155,9 +152,6 @@ static const struct plugin_api rockbox_api = { | |||
155 | lcd_remote_puts, | 152 | lcd_remote_puts, |
156 | lcd_remote_puts_scroll, | 153 | lcd_remote_puts_scroll, |
157 | lcd_remote_stop_scroll, | 154 | lcd_remote_stop_scroll, |
158 | #ifndef SIMULATOR | ||
159 | lcd_remote_roll, | ||
160 | #endif | ||
161 | lcd_remote_set_drawmode, | 155 | lcd_remote_set_drawmode, |
162 | lcd_remote_get_drawmode, | 156 | lcd_remote_get_drawmode, |
163 | lcd_remote_setfont, | 157 | lcd_remote_setfont, |
@@ -245,6 +239,14 @@ static const struct plugin_api rockbox_api = { | |||
245 | profile_func_exit, | 239 | profile_func_exit, |
246 | #endif | 240 | #endif |
247 | 241 | ||
242 | #ifdef SIMULATOR | ||
243 | /* special simulator hooks */ | ||
244 | #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 | ||
245 | sim_lcd_ex_init, | ||
246 | sim_lcd_ex_update_rect, | ||
247 | #endif | ||
248 | #endif | ||
249 | |||
248 | /* strings and memory */ | 250 | /* strings and memory */ |
249 | snprintf, | 251 | snprintf, |
250 | strcpy, | 252 | strcpy, |
@@ -290,6 +292,7 @@ static const struct plugin_api rockbox_api = { | |||
290 | pcm_set_frequency, | 292 | pcm_set_frequency, |
291 | pcm_is_playing, | 293 | pcm_is_playing, |
292 | pcm_play_pause, | 294 | pcm_play_pause, |
295 | pcm_calculate_peaks, | ||
293 | #endif | 296 | #endif |
294 | #endif | 297 | #endif |
295 | 298 | ||
@@ -401,18 +404,10 @@ static const struct plugin_api rockbox_api = { | |||
401 | screen_dump_set_hook, | 404 | screen_dump_set_hook, |
402 | #endif | 405 | #endif |
403 | show_logo, | 406 | show_logo, |
407 | tree_get_context, | ||
404 | 408 | ||
405 | /* new stuff at the end, sort into place next time | 409 | /* new stuff at the end, sort into place next time |
406 | the API gets incompatible */ | 410 | the API gets incompatible */ |
407 | tree_get_context, | ||
408 | #if defined(SIMULATOR) && defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 | ||
409 | sim_lcd_ex_init, | ||
410 | sim_lcd_ex_update_rect, | ||
411 | #endif | ||
412 | |||
413 | #if (CONFIG_CODEC == SWCODEC) | ||
414 | pcm_calculate_peaks, | ||
415 | #endif | ||
416 | }; | 411 | }; |
417 | 412 | ||
418 | int plugin_load(const char* plugin, void* parameter) | 413 | int plugin_load(const char* plugin, void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index 81a58626bf..ed4588d906 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -99,12 +99,12 @@ | |||
99 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 99 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
100 | 100 | ||
101 | /* increase this every time the api struct changes */ | 101 | /* increase this every time the api struct changes */ |
102 | #define PLUGIN_API_VERSION 10 | 102 | #define PLUGIN_API_VERSION 11 |
103 | 103 | ||
104 | /* update this to latest version if a change to the api struct breaks | 104 | /* update this to latest version if a change to the api struct breaks |
105 | backwards compatibility (and please take the opportunity to sort in any | 105 | backwards compatibility (and please take the opportunity to sort in any |
106 | new function which are "waiting" at the end of the function table) */ | 106 | new function which are "waiting" at the end of the function table) */ |
107 | #define PLUGIN_MIN_API_VERSION 10 | 107 | #define PLUGIN_MIN_API_VERSION 11 |
108 | 108 | ||
109 | /* plugin return codes */ | 109 | /* plugin return codes */ |
110 | enum plugin_status { | 110 | enum plugin_status { |
@@ -137,9 +137,6 @@ struct plugin_api { | |||
137 | void (*PREFIX(lcd_icon))(int icon, bool enable); | 137 | void (*PREFIX(lcd_icon))(int icon, bool enable); |
138 | void (*lcd_double_height)(bool on); | 138 | void (*lcd_double_height)(bool on); |
139 | #else | 139 | #else |
140 | #ifndef SIMULATOR | ||
141 | void (*lcd_roll)(int pixels); | ||
142 | #endif | ||
143 | void (*lcd_set_drawmode)(int mode); | 140 | void (*lcd_set_drawmode)(int mode); |
144 | int (*lcd_get_drawmode)(void); | 141 | int (*lcd_get_drawmode)(void); |
145 | void (*lcd_setfont)(int font); | 142 | void (*lcd_setfont)(int font); |
@@ -200,9 +197,6 @@ struct plugin_api { | |||
200 | void (*lcd_remote_puts)(int x, int y, const unsigned char *string); | 197 | void (*lcd_remote_puts)(int x, int y, const unsigned char *string); |
201 | void (*lcd_remote_lcd_puts_scroll)(int x, int y, const unsigned char* string); | 198 | void (*lcd_remote_lcd_puts_scroll)(int x, int y, const unsigned char* string); |
202 | void (*lcd_remote_lcd_stop_scroll)(void); | 199 | void (*lcd_remote_lcd_stop_scroll)(void); |
203 | #ifndef SIMULATOR | ||
204 | void (*lcd_remote_roll)(int pixels); | ||
205 | #endif | ||
206 | void (*lcd_remote_set_drawmode)(int mode); | 200 | void (*lcd_remote_set_drawmode)(int mode); |
207 | int (*lcd_remote_get_drawmode)(void); | 201 | int (*lcd_remote_get_drawmode)(void); |
208 | void (*lcd_remote_setfont)(int font); | 202 | void (*lcd_remote_setfont)(int font); |
@@ -298,6 +292,14 @@ struct plugin_api { | |||
298 | void (*profile_func_exit)(void *this_fn, void *call_site); | 292 | void (*profile_func_exit)(void *this_fn, void *call_site); |
299 | #endif | 293 | #endif |
300 | 294 | ||
295 | #ifdef SIMULATOR | ||
296 | /* special simulator hooks */ | ||
297 | #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 | ||
298 | void (*sim_lcd_ex_init)(int shades, unsigned long (*getpixel)(int, int)); | ||
299 | void (*sim_lcd_ex_update_rect)(int x, int y, int width, int height); | ||
300 | #endif | ||
301 | #endif | ||
302 | |||
301 | /* strings and memory */ | 303 | /* strings and memory */ |
302 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); | 304 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); |
303 | char* (*strcpy)(char *dst, const char *src); | 305 | char* (*strcpy)(char *dst, const char *src); |
@@ -344,6 +346,7 @@ struct plugin_api { | |||
344 | void (*pcm_set_frequency)(unsigned int frequency); | 346 | void (*pcm_set_frequency)(unsigned int frequency); |
345 | bool (*pcm_is_playing)(void); | 347 | bool (*pcm_is_playing)(void); |
346 | void (*pcm_play_pause)(bool play); | 348 | void (*pcm_play_pause)(bool play); |
349 | void (*pcm_calculate_peaks)(int *left, int *right); | ||
347 | #endif | 350 | #endif |
348 | #endif /* !SIMULATOR */ | 351 | #endif /* !SIMULATOR */ |
349 | 352 | ||
@@ -466,16 +469,7 @@ struct plugin_api { | |||
466 | void (*screen_dump_set_hook)(void (*hook)(int fh)); | 469 | void (*screen_dump_set_hook)(void (*hook)(int fh)); |
467 | #endif | 470 | #endif |
468 | int (*show_logo)(void); | 471 | int (*show_logo)(void); |
469 | |||
470 | struct tree_context* (*tree_get_context)(void); | 472 | struct tree_context* (*tree_get_context)(void); |
471 | #if defined(SIMULATOR) && defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 | ||
472 | void (*sim_lcd_ex_init)(int shades, unsigned long (*getpixel)(int, int)); | ||
473 | void (*sim_lcd_ex_update_rect)(int x, int y, int width, int height); | ||
474 | #endif | ||
475 | |||
476 | #if (CONFIG_CODEC == SWCODEC) | ||
477 | void (*pcm_calculate_peaks)(int *left, int *right); | ||
478 | #endif | ||
479 | 473 | ||
480 | /* new stuff at the end, sort into place next time | 474 | /* new stuff at the end, sort into place next time |
481 | the API gets incompatible */ | 475 | the API gets incompatible */ |
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index a0c2f3630b..75c88b3b70 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -44,7 +44,6 @@ chip8.c | |||
44 | demystify.c | 44 | demystify.c |
45 | flipit.c | 45 | flipit.c |
46 | minesweeper.c | 46 | minesweeper.c |
47 | oscillograph.c | ||
48 | oscilloscope.c | 47 | oscilloscope.c |
49 | pong.c | 48 | pong.c |
50 | rockblox.c | 49 | rockblox.c |
diff --git a/apps/plugins/oscillograph.c b/apps/plugins/oscillograph.c deleted file mode 100644 index ed0e7a87af..0000000000 --- a/apps/plugins/oscillograph.c +++ /dev/null | |||
@@ -1,300 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Philipp Pertermann | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "plugin.h" | ||
20 | |||
21 | #ifdef HAVE_LCD_BITMAP | ||
22 | |||
23 | PLUGIN_HEADER | ||
24 | |||
25 | /* The different drawing modes */ | ||
26 | #define DRAW_MODE_FILLED 0 | ||
27 | #define DRAW_MODE_OUTLINE 1 | ||
28 | #define DRAW_MODE_PIXEL 2 | ||
29 | #define DRAW_MODE_COUNT 3 | ||
30 | |||
31 | #define MAX_PEAK 0x8000 | ||
32 | |||
33 | /* variable button definitions */ | ||
34 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
35 | #define OSCILLOGRAPH_QUIT BUTTON_OFF | ||
36 | #define OSCILLOGRAPH_SPEED_UP BUTTON_UP | ||
37 | #define OSCILLOGRAPH_SPEED_DOWN BUTTON_DOWN | ||
38 | #define OSCILLOGRAPH_ROLL BUTTON_F1 | ||
39 | #define OSCILLOGRAPH_MODE BUTTON_F2 | ||
40 | #define OSCILLOGRAPH_SPEED_RESET BUTTON_F3 | ||
41 | #define OSCILLOGRAPH_PAUSE BUTTON_PLAY | ||
42 | |||
43 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
44 | #define OSCILLOGRAPH_QUIT BUTTON_OFF | ||
45 | #define OSCILLOGRAPH_SPEED_UP BUTTON_UP | ||
46 | #define OSCILLOGRAPH_SPEED_DOWN BUTTON_DOWN | ||
47 | #define OSCILLOGRAPH_ROLL BUTTON_RIGHT | ||
48 | #define OSCILLOGRAPH_MODE BUTTON_MENU | ||
49 | #define OSCILLOGRAPH_SPEED_RESET BUTTON_LEFT | ||
50 | |||
51 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | ||
52 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
53 | #define OSCILLOGRAPH_QUIT BUTTON_OFF | ||
54 | #define OSCILLOGRAPH_SPEED_UP BUTTON_UP | ||
55 | #define OSCILLOGRAPH_SPEED_DOWN BUTTON_DOWN | ||
56 | #define OSCILLOGRAPH_ROLL BUTTON_RIGHT | ||
57 | #define OSCILLOGRAPH_MODE BUTTON_SELECT | ||
58 | #define OSCILLOGRAPH_SPEED_RESET BUTTON_LEFT | ||
59 | |||
60 | #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | ||
61 | (CONFIG_KEYPAD == IPOD_4G_PAD) | ||
62 | #define OSCILLOGRAPH_QUIT BUTTON_MENU | ||
63 | #define OSCILLOGRAPH_SPEED_UP BUTTON_SCROLL_FWD | ||
64 | #define OSCILLOGRAPH_SPEED_DOWN BUTTON_SCROLL_BACK | ||
65 | #define OSCILLOGRAPH_ROLL BUTTON_RIGHT | ||
66 | #define OSCILLOGRAPH_MODE BUTTON_SELECT | ||
67 | #define OSCILLOGRAPH_SPEED_RESET BUTTON_LEFT | ||
68 | |||
69 | #elif (CONFIG_KEYPAD == GIGABEAT_PAD) | ||
70 | #define OSCILLOGRAPH_QUIT BUTTON_POWER | ||
71 | #define OSCILLOGRAPH_SPEED_UP BUTTON_UP | ||
72 | #define OSCILLOGRAPH_SPEED_DOWN BUTTON_DOWN | ||
73 | #define OSCILLOGRAPH_ROLL BUTTON_RIGHT | ||
74 | #define OSCILLOGRAPH_MODE BUTTON_SELECT | ||
75 | #define OSCILLOGRAPH_SPEED_RESET BUTTON_LEFT | ||
76 | |||
77 | #elif CONFIG_KEYPAD == IAUDIO_X5_PAD | ||
78 | #define OSCILLOGRAPH_QUIT BUTTON_POWER | ||
79 | #define OSCILLOGRAPH_SPEED_UP BUTTON_UP | ||
80 | #define OSCILLOGRAPH_SPEED_DOWN BUTTON_DOWN | ||
81 | #define OSCILLOGRAPH_ROLL BUTTON_RIGHT | ||
82 | #define OSCILLOGRAPH_MODE BUTTON_SELECT | ||
83 | #define OSCILLOGRAPH_SPEED_RESET BUTTON_LEFT | ||
84 | |||
85 | #endif | ||
86 | |||
87 | #if SIMULATOR && (CONFIG_CODEC != SWCODEC) | ||
88 | #define mas_codec_readreg(x) rand()%MAX_PEAK | ||
89 | #endif | ||
90 | |||
91 | /* global api struct pointer */ | ||
92 | static struct plugin_api* rb; | ||
93 | /* number of ticks between two volume samples */ | ||
94 | static int speed = 1; | ||
95 | #ifndef SIMULATOR | ||
96 | /* roll == true -> lcd rolls */ | ||
97 | static bool roll = true; | ||
98 | #endif | ||
99 | /* see DRAW_MODE_XXX constants for valid values */ | ||
100 | static int drawMode = DRAW_MODE_FILLED; | ||
101 | |||
102 | /** | ||
103 | * cleanup on return / usb | ||
104 | */ | ||
105 | void cleanup(void *parameter) | ||
106 | { | ||
107 | (void)parameter; | ||
108 | #ifndef SIMULATOR | ||
109 | /* restore to default roll position. | ||
110 | Looks funny if you forget to do this... */ | ||
111 | rb->lcd_roll(0); | ||
112 | #endif | ||
113 | rb->lcd_update(); | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * Displays a vertically scrolling oscillosgraph using | ||
118 | * hardware scrolling of the display. The user can change | ||
119 | * speed | ||
120 | */ | ||
121 | enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | ||
122 | { | ||
123 | int button; | ||
124 | /* stores current volume value left */ | ||
125 | int left; | ||
126 | /* stores current volume value right */ | ||
127 | int right; | ||
128 | /* specifies the current position on the lcd */ | ||
129 | int y = LCD_WIDTH - 1; | ||
130 | |||
131 | /* only needed when drawing lines */ | ||
132 | int lastLeft = 0; | ||
133 | int lastRight = 0; | ||
134 | int lasty = 0; | ||
135 | |||
136 | bool exit = false; | ||
137 | |||
138 | (void)parameter; | ||
139 | rb = api; | ||
140 | |||
141 | /* the main loop */ | ||
142 | while (!exit) { | ||
143 | |||
144 | /* read the volume info */ | ||
145 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | ||
146 | left = rb->mas_codec_readreg(0xC); | ||
147 | right = rb->mas_codec_readreg(0xD); | ||
148 | #elif (CONFIG_CODEC == SWCODEC) | ||
149 | rb->pcm_calculate_peaks(&left, &right); | ||
150 | #endif | ||
151 | |||
152 | left = left / (MAX_PEAK / (LCD_WIDTH / 2 - 2)); | ||
153 | right = right / (MAX_PEAK / (LCD_WIDTH / 2 - 2)); | ||
154 | |||
155 | /* delete current line */ | ||
156 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
157 | rb->lcd_drawline(0, y, LCD_WIDTH-1, y); | ||
158 | |||
159 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
160 | switch (drawMode) { | ||
161 | case DRAW_MODE_FILLED: | ||
162 | rb->lcd_drawline(LCD_WIDTH / 2 + 1 , y, | ||
163 | LCD_WIDTH / 2 + 1 + right, y); | ||
164 | rb->lcd_drawline(LCD_WIDTH / 2 - 1 , y, | ||
165 | LCD_WIDTH / 2 - 1 -left , y); | ||
166 | break; | ||
167 | |||
168 | case DRAW_MODE_OUTLINE: | ||
169 | /* last position needed for lines */ | ||
170 | lasty = MAX(y-1, 0); | ||
171 | |||
172 | /* Here real lines were neccessary because | ||
173 | anything else was ugly. */ | ||
174 | rb->lcd_drawline(LCD_WIDTH / 2 + right , y, | ||
175 | LCD_WIDTH / 2 + lastRight , lasty); | ||
176 | rb->lcd_drawline(LCD_WIDTH / 2 - left , y, | ||
177 | LCD_WIDTH / 2 - lastLeft, lasty); | ||
178 | |||
179 | /* have to store the old values for drawing lines | ||
180 | the next time */ | ||
181 | lastRight = right; | ||
182 | lastLeft = left; | ||
183 | break; | ||
184 | |||
185 | case DRAW_MODE_PIXEL: | ||
186 | /* straight and simple */ | ||
187 | rb->lcd_drawpixel(LCD_WIDTH / 2 + right, y); | ||
188 | rb->lcd_drawpixel(LCD_WIDTH / 2 - left, y); | ||
189 | break; | ||
190 | } | ||
191 | |||
192 | |||
193 | /* increment and adjust the drawing position */ | ||
194 | y++; | ||
195 | if (y >= LCD_HEIGHT) | ||
196 | y = 0; | ||
197 | |||
198 | #ifndef SIMULATOR | ||
199 | /* I roll before update because otherwise the new | ||
200 | line would appear at the wrong end of the display */ | ||
201 | if (roll) | ||
202 | rb->lcd_roll(y); | ||
203 | #endif | ||
204 | |||
205 | /* now finally make the new sample visible */ | ||
206 | rb->lcd_update_rect(0, MAX(y-1, 0), LCD_WIDTH, 2); | ||
207 | |||
208 | /* There are two mechanisms to alter speed: | ||
209 | 1.) slowing down is achieved by increasing | ||
210 | the time waiting for user input. This | ||
211 | mechanism uses positive values. | ||
212 | 2.) speeding up is achieved by leaving out | ||
213 | the user input check for (-speed) volume | ||
214 | samples. For this mechanism negative values | ||
215 | are used. | ||
216 | */ | ||
217 | |||
218 | if (speed >= 0 || ((speed < 0) && (y % (-speed) == 0))) { | ||
219 | bool draw = false; | ||
220 | |||
221 | /* speed values > 0 slow the oszi down. By user input | ||
222 | speed might become < 1. If a value < 1 was | ||
223 | passed user input would be disabled. Thus | ||
224 | it must be ensured that at least 1 is passed. */ | ||
225 | |||
226 | /* react to user input */ | ||
227 | button = rb->button_get_w_tmo(MAX(speed, 1)); | ||
228 | switch (button) { | ||
229 | case OSCILLOGRAPH_SPEED_UP: | ||
230 | speed++; | ||
231 | draw = true; | ||
232 | break; | ||
233 | |||
234 | case OSCILLOGRAPH_SPEED_DOWN: | ||
235 | speed--; | ||
236 | draw = true; | ||
237 | break; | ||
238 | |||
239 | #ifdef OSCILLOGRAPH_PAUSE | ||
240 | case OSCILLOGRAPH_PAUSE: | ||
241 | /* pause the demo */ | ||
242 | rb->button_get(true); | ||
243 | break; | ||
244 | #endif | ||
245 | |||
246 | #ifndef SIMULATOR | ||
247 | case OSCILLOGRAPH_ROLL: | ||
248 | /* toggle rolling */ | ||
249 | roll = !roll; | ||
250 | break; | ||
251 | #endif | ||
252 | |||
253 | case OSCILLOGRAPH_MODE: | ||
254 | /* step through the display modes */ | ||
255 | drawMode ++; | ||
256 | drawMode = drawMode % DRAW_MODE_COUNT; | ||
257 | |||
258 | #ifndef SIMULATOR | ||
259 | /* lcd buffer might be rolled so that | ||
260 | the transition from LCD_HEIGHT to 0 | ||
261 | takes place in the middle of the screen. | ||
262 | That produces ugly results in DRAW_MODE_OUTLINE | ||
263 | mode. If rolling is enabled this change will | ||
264 | be reverted before the next update anyway.*/ | ||
265 | rb->lcd_roll(0); | ||
266 | #endif | ||
267 | break; | ||
268 | |||
269 | case OSCILLOGRAPH_SPEED_RESET: | ||
270 | speed = 1; | ||
271 | draw = true; | ||
272 | break; | ||
273 | |||
274 | case OSCILLOGRAPH_QUIT: | ||
275 | exit = true; | ||
276 | break; | ||
277 | |||
278 | default: | ||
279 | if (rb->default_event_handler_ex(button, cleanup, NULL) | ||
280 | == SYS_USB_CONNECTED) | ||
281 | return PLUGIN_USB_CONNECTED; | ||
282 | break; | ||
283 | } | ||
284 | |||
285 | if (draw) { | ||
286 | char buf[16]; | ||
287 | rb->snprintf(buf, sizeof buf, "Speed: %d", -speed); | ||
288 | rb->lcd_putsxy(0, (y + LCD_HEIGHT - 8) % LCD_HEIGHT, buf); | ||
289 | rb->lcd_update_rect(0, (y + LCD_HEIGHT - 8) % LCD_HEIGHT, | ||
290 | LCD_WIDTH, 8); | ||
291 | } | ||
292 | } | ||
293 | } | ||
294 | |||
295 | cleanup(NULL); | ||
296 | /* standard return */ | ||
297 | return PLUGIN_OK; | ||
298 | } | ||
299 | |||
300 | #endif | ||
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index df735ca40d..a6d584c3fb 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c | |||
@@ -100,7 +100,6 @@ static bool remote_initialized = false; | |||
100 | static bool cached_invert = false; | 100 | static bool cached_invert = false; |
101 | static bool cached_flip = false; | 101 | static bool cached_flip = false; |
102 | static int cached_contrast = 32; | 102 | static int cached_contrast = 32; |
103 | static int cached_roll = 0; | ||
104 | #endif | 103 | #endif |
105 | 104 | ||
106 | /* scrolling */ | 105 | /* scrolling */ |
@@ -393,30 +392,6 @@ void lcd_remote_set_flip(bool yesno) | |||
393 | } | 392 | } |
394 | } | 393 | } |
395 | 394 | ||
396 | /* Rolls up the lcd display by the specified amount of lines. | ||
397 | * Lines that are rolled out over the top of the screen are | ||
398 | * rolled in from the bottom again. This is a hardware | ||
399 | * remapping only and all operations on the lcd are affected. | ||
400 | * -> | ||
401 | * @param int lines - The number of lines that are rolled. | ||
402 | * The value must be 0 <= pixels < LCD_REMOTE_HEIGHT. */ | ||
403 | void lcd_remote_roll(int lines) | ||
404 | { | ||
405 | char data[2]; | ||
406 | |||
407 | cached_roll = lines; | ||
408 | |||
409 | if (remote_initialized) | ||
410 | { | ||
411 | lines &= LCD_REMOTE_HEIGHT-1; | ||
412 | data[0] = lines & 0xff; | ||
413 | data[1] = lines >> 8; | ||
414 | |||
415 | lcd_remote_write_command(LCD_REMOTE_CNTL_INIT_LINE | 0x0); // init line | ||
416 | lcd_remote_write_data(data, 2); | ||
417 | } | ||
418 | } | ||
419 | |||
420 | /* The actual LCD init */ | 395 | /* The actual LCD init */ |
421 | static void remote_lcd_init(void) | 396 | static void remote_lcd_init(void) |
422 | { | 397 | { |
@@ -443,7 +418,6 @@ static void remote_lcd_init(void) | |||
443 | lcd_remote_set_flip(cached_flip); | 418 | lcd_remote_set_flip(cached_flip); |
444 | lcd_remote_set_contrast(cached_contrast); | 419 | lcd_remote_set_contrast(cached_contrast); |
445 | lcd_remote_set_invert_display(cached_invert); | 420 | lcd_remote_set_invert_display(cached_invert); |
446 | lcd_remote_roll(cached_roll); | ||
447 | } | 421 | } |
448 | 422 | ||
449 | static int _remote_type = 0; | 423 | static int _remote_type = 0; |
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index 7b67ad023c..1d80458679 100644 --- a/firmware/drivers/lcd-h100.c +++ b/firmware/drivers/lcd-h100.c | |||
@@ -136,19 +136,6 @@ void lcd_set_flip(bool yesno) | |||
136 | } | 136 | } |
137 | } | 137 | } |
138 | 138 | ||
139 | /* Rolls up the lcd display by the specified amount of lines. | ||
140 | * Lines that are rolled out over the top of the screen are | ||
141 | * rolled in from the bottom again. This is a hardware | ||
142 | * remapping only and all operations on the lcd are affected. | ||
143 | * -> | ||
144 | * @param int lines - The number of lines that are rolled. | ||
145 | * The value must be 0 <= pixels < LCD_HEIGHT. */ | ||
146 | void lcd_roll(int lines) | ||
147 | { | ||
148 | lines &= LCD_HEIGHT-1; | ||
149 | lcd_write_command_ex(LCD_CNTL_DISPLAY_START_LINE, lines, -1); | ||
150 | } | ||
151 | |||
152 | #endif /* !SIMULATOR */ | 139 | #endif /* !SIMULATOR */ |
153 | 140 | ||
154 | /* LCD init */ | 141 | /* LCD init */ |
@@ -163,8 +150,6 @@ void lcd_init(void) | |||
163 | 150 | ||
164 | void lcd_init(void) | 151 | void lcd_init(void) |
165 | { | 152 | { |
166 | static unsigned char area_data[4] = { 0x01, 0x00, 0x7f, 0x80 }; | ||
167 | |||
168 | /* GPO35 is the LCD A0 pin | 153 | /* GPO35 is the LCD A0 pin |
169 | GPO46 is LCD RESET */ | 154 | GPO46 is LCD RESET */ |
170 | or_l(0x00004008, &GPIO1_OUT); | 155 | or_l(0x00004008, &GPIO1_OUT); |
@@ -198,9 +183,6 @@ void lcd_init(void) | |||
198 | sleep(HZ/10); /* 100 ms pause */ | 183 | sleep(HZ/10); /* 100 ms pause */ |
199 | lcd_write_command_ex(LCD_CNTL_POWER_CONTROL, 0x17, -1); | 184 | lcd_write_command_ex(LCD_CNTL_POWER_CONTROL, 0x17, -1); |
200 | 185 | ||
201 | lcd_write_command(LCD_CNTL_AREA_SCROLL); | ||
202 | lcd_write_data(area_data, sizeof(area_data)); | ||
203 | |||
204 | lcd_write_command_ex(LCD_CNTL_DISPLAY_START_LINE, 0, -1); | 186 | lcd_write_command_ex(LCD_CNTL_DISPLAY_START_LINE, 0, -1); |
205 | lcd_write_command_ex(LCD_CNTL_GRAY_SCALE_PATTERN, 0x42, -1); | 187 | lcd_write_command_ex(LCD_CNTL_GRAY_SCALE_PATTERN, 0x42, -1); |
206 | lcd_write_command_ex(LCD_CNTL_DISPLAY_MODE, 0, -1); /* Greyscale mode */ | 188 | lcd_write_command_ex(LCD_CNTL_DISPLAY_MODE, 0, -1); /* Greyscale mode */ |
diff --git a/firmware/drivers/lcd-h300.c b/firmware/drivers/lcd-h300.c index 8ee6b1c47e..046bd3a9cb 100644 --- a/firmware/drivers/lcd-h300.c +++ b/firmware/drivers/lcd-h300.c | |||
@@ -107,19 +107,6 @@ void lcd_set_flip(bool yesno) | |||
107 | (void)yesno; | 107 | (void)yesno; |
108 | } | 108 | } |
109 | 109 | ||
110 | /* Rolls up the lcd display by the specified amount of lines. | ||
111 | * Lines that are rolled out over the top of the screen are | ||
112 | * rolled in from the bottom again. This is a hardware | ||
113 | * remapping only and all operations on the lcd are affected. | ||
114 | * -> | ||
115 | * @param int lines - The number of lines that are rolled. | ||
116 | * The value must be 0 <= pixels < LCD_HEIGHT. */ | ||
117 | void lcd_roll(int lines) | ||
118 | { | ||
119 | (void)lines; | ||
120 | } | ||
121 | |||
122 | |||
123 | /* LCD init */ | 110 | /* LCD init */ |
124 | void lcd_init_device(void) | 111 | void lcd_init_device(void) |
125 | { | 112 | { |
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c index 4df47f9f20..2d190d3d70 100644 --- a/firmware/drivers/lcd-ipod.c +++ b/firmware/drivers/lcd-ipod.c | |||
@@ -141,19 +141,6 @@ void lcd_blit(const unsigned char* data, int x, int by, int width, | |||
141 | (void)stride; | 141 | (void)stride; |
142 | } | 142 | } |
143 | 143 | ||
144 | /* Rolls up the lcd display by the specified amount of lines. | ||
145 | * Lines that are rolled out over the top of the screen are | ||
146 | * rolled in from the bottom again. This is a hardware | ||
147 | * remapping only and all operations on the lcd are affected. | ||
148 | * -> | ||
149 | * @param int lines - The number of lines that are rolled. | ||
150 | * The value must be 0 <= pixels < LCD_HEIGHT. */ | ||
151 | void lcd_roll(int lines) | ||
152 | { | ||
153 | /* TODO Implement lcd_roll() */ | ||
154 | lines &= LCD_HEIGHT-1; | ||
155 | } | ||
156 | |||
157 | /*** hardware configuration ***/ | 144 | /*** hardware configuration ***/ |
158 | 145 | ||
159 | /* Update the display. | 146 | /* Update the display. |
@@ -314,19 +301,6 @@ void lcd_set_flip(bool yesno) | |||
314 | (void)yesno; | 301 | (void)yesno; |
315 | } | 302 | } |
316 | 303 | ||
317 | /* Rolls up the lcd display by the specified amount of lines. | ||
318 | * Lines that are rolled out over the top of the screen are | ||
319 | * rolled in from the bottom again. This is a hardware | ||
320 | * remapping only and all operations on the lcd are affected. | ||
321 | * -> | ||
322 | * @param int lines - The number of lines that are rolled. | ||
323 | * The value must be 0 <= pixels < LCD_HEIGHT. */ | ||
324 | void lcd_roll(int lines) | ||
325 | { | ||
326 | /* TODO: Implement lcd_roll() */ | ||
327 | lines &= LCD_HEIGHT-1; | ||
328 | } | ||
329 | |||
330 | /* LCD init */ | 304 | /* LCD init */ |
331 | void lcd_init_device(void) | 305 | void lcd_init_device(void) |
332 | { | 306 | { |
diff --git a/firmware/drivers/lcd-ipodvideo.c b/firmware/drivers/lcd-ipodvideo.c index 066616959e..84b830377e 100644 --- a/firmware/drivers/lcd-ipodvideo.c +++ b/firmware/drivers/lcd-ipodvideo.c | |||
@@ -50,19 +50,6 @@ void lcd_set_flip(bool yesno) | |||
50 | (void)yesno; | 50 | (void)yesno; |
51 | } | 51 | } |
52 | 52 | ||
53 | /* Rolls up the lcd display by the specified amount of lines. | ||
54 | * Lines that are rolled out over the top of the screen are | ||
55 | * rolled in from the bottom again. This is a hardware | ||
56 | * remapping only and all operations on the lcd are affected. | ||
57 | * -> | ||
58 | * @param int lines - The number of lines that are rolled. | ||
59 | * The value must be 0 <= pixels < LCD_HEIGHT. */ | ||
60 | void lcd_roll(int lines) | ||
61 | { | ||
62 | /* TODO: Implement lcd_roll() */ | ||
63 | lines &= LCD_HEIGHT-1; | ||
64 | } | ||
65 | |||
66 | /* LCD init */ | 53 | /* LCD init */ |
67 | void lcd_init_device(void) | 54 | void lcd_init_device(void) |
68 | { | 55 | { |
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 22388815ae..7a44acf590 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -226,18 +226,6 @@ void lcd_set_flip(bool yesno) | |||
226 | #endif | 226 | #endif |
227 | } | 227 | } |
228 | 228 | ||
229 | /* Rolls up the lcd display by the specified amount of lines. | ||
230 | * Lines that are rolled out over the top of the screen are | ||
231 | * rolled in from the bottom again. This is a hardware | ||
232 | * remapping only and all operations on the lcd are affected. | ||
233 | * -> | ||
234 | * @param int lines - The number of lines that are rolled. | ||
235 | * The value must be 0 <= pixels < LCD_HEIGHT. */ | ||
236 | void lcd_roll(int lines) | ||
237 | { | ||
238 | lcd_write_command(LCD_SET_DISPLAY_START_LINE | (lines & (LCD_HEIGHT-1))); | ||
239 | } | ||
240 | |||
241 | #endif /* !SIMULATOR */ | 229 | #endif /* !SIMULATOR */ |
242 | 230 | ||
243 | /* LCD init */ | 231 | /* LCD init */ |