diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-28 00:00:24 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-28 00:00:24 +0000 |
commit | 451dd48adc2ef29fd2f900693393cc9b9b4a849b (patch) | |
tree | e15d20e602261866617210bde007966ce9b19293 /apps/debug_menu.c | |
parent | 853bc3dcf85aa1284a0e5b550277c40beb7697a9 (diff) | |
download | rockbox-451dd48adc2ef29fd2f900693393cc9b9b4a849b.tar.gz rockbox-451dd48adc2ef29fd2f900693393cc9b9b4a849b.zip |
Sound api improvements, rockboy sound, contributed by xshock.
Playback of sound currently only works in boost mode, needs fixing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6226 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 9d5028af7c..74d1cb94fb 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -169,27 +169,29 @@ static void test_get_more(unsigned char **ptr, long *size) | |||
169 | bool uda1380_test(void) | 169 | bool uda1380_test(void) |
170 | { | 170 | { |
171 | long button; | 171 | long button; |
172 | int vol = 0x7f; | 172 | int vol = 0x50; |
173 | bool done = false; | 173 | bool done = false; |
174 | 174 | ||
175 | lcd_setmargins(0, 0); | 175 | lcd_setmargins(0, 0); |
176 | lcd_clear_display(); | 176 | lcd_clear_display(); |
177 | lcd_update(); | 177 | lcd_update(); |
178 | cpu_boost(true); | ||
178 | 179 | ||
179 | if (load_wave("/sample.wav") == -1) | 180 | if (load_wave("/sample.wav") == -1) |
180 | goto exit; | 181 | goto exit; |
181 | 182 | ||
182 | audio_pos = 0; | 183 | audio_pos = 0; |
183 | 184 | ||
185 | puts("Playing.."); | ||
184 | puts("uda1380_init"); | 186 | puts("uda1380_init"); |
185 | if (uda1380_init() == -1) | 187 | if (uda1380_init() == -1) |
186 | { | 188 | { |
187 | puts("Init failed.."); | 189 | puts("UDA1380 init failed"); |
188 | goto exit; | ||
189 | } | 190 | } |
190 | 191 | ||
191 | puts("Playing.."); | ||
192 | audio_pos = 0; | 192 | audio_pos = 0; |
193 | pcm_set_frequency(44100); | ||
194 | pcm_set_volume(0xff - vol); | ||
193 | pcm_play_data(audio_buffer, CHUNK_SIZE, | 195 | pcm_play_data(audio_buffer, CHUNK_SIZE, |
194 | test_get_more); | 196 | test_get_more); |
195 | 197 | ||
@@ -224,6 +226,7 @@ bool uda1380_test(void) | |||
224 | 226 | ||
225 | exit: | 227 | exit: |
226 | sleep(HZ >> 1); /* Sleep 1/2 second to fade out sound */ | 228 | sleep(HZ >> 1); /* Sleep 1/2 second to fade out sound */ |
229 | cpu_boost(false); | ||
227 | 230 | ||
228 | return false; | 231 | return false; |
229 | } | 232 | } |
@@ -1247,10 +1250,9 @@ bool view_battery(void) | |||
1247 | lcd_puts(0, 3, buf); | 1250 | lcd_puts(0, 3, buf); |
1248 | #endif | 1251 | #endif |
1249 | #ifdef HAVE_CHARGE_CTRL | 1252 | #ifdef HAVE_CHARGE_CTRL |
1250 | snprintf(buf, 30, "Chgr: %s %s", | 1253 | snprintf(buf, 30, "Charging: %s", |
1251 | charger_inserted() ? "present" : "absent", | 1254 | charger_enabled ? "yes" : "no"); |
1252 | charger_enabled ? "on" : "off"); | 1255 | lcd_puts(0, 4, buf); |
1253 | lcd_puts(0, 3, buf); | ||
1254 | snprintf(buf, 30, "short delta: %d", short_delta); | 1256 | snprintf(buf, 30, "short delta: %d", short_delta); |
1255 | lcd_puts(0, 5, buf); | 1257 | lcd_puts(0, 5, buf); |
1256 | snprintf(buf, 30, "long delta: %d", long_delta); | 1258 | snprintf(buf, 30, "long delta: %d", long_delta); |
@@ -1272,7 +1274,7 @@ bool view_battery(void) | |||
1272 | } | 1274 | } |
1273 | break; | 1275 | break; |
1274 | 1276 | ||
1275 | case 3: /* remaining time estimation: */ | 1277 | case 3: /* remeining time estimation: */ |
1276 | lcd_clear_display(); | 1278 | lcd_clear_display(); |
1277 | 1279 | ||
1278 | #ifdef HAVE_CHARGE_CTRL | 1280 | #ifdef HAVE_CHARGE_CTRL |
@@ -1284,24 +1286,23 @@ bool view_battery(void) | |||
1284 | 1286 | ||
1285 | snprintf(buf, 30, "Lvl@cyc st: %d%%", powermgmt_last_cycle_level); | 1287 | snprintf(buf, 30, "Lvl@cyc st: %d%%", powermgmt_last_cycle_level); |
1286 | lcd_puts(0, 2, buf); | 1288 | lcd_puts(0, 2, buf); |
1287 | |||
1288 | snprintf(buf, 30, "P=%2d I=%2d", pid_p, pid_i); | ||
1289 | lcd_puts(0, 3, buf); | ||
1290 | |||
1291 | snprintf(buf, 30, "Trickle sec: %d/60", trickle_sec); | ||
1292 | lcd_puts(0, 4, buf); | ||
1293 | #endif | 1289 | #endif |
1294 | 1290 | ||
1295 | snprintf(buf, 30, "Last PwrHist: %d.%02d V", | 1291 | snprintf(buf, 30, "Last PwrHist: %d.%02d V", |
1296 | power_history[0] / 100, | 1292 | power_history[0] / 100, |
1297 | power_history[0] % 100); | 1293 | power_history[0] % 100); |
1298 | lcd_puts(0, 5, buf); | 1294 | lcd_puts(0, 3, buf); |
1299 | 1295 | ||
1300 | snprintf(buf, 30, "battery level: %d%%", battery_level()); | 1296 | snprintf(buf, 30, "battery level: %d%%", battery_level()); |
1301 | lcd_puts(0, 6, buf); | 1297 | lcd_puts(0, 5, buf); |
1302 | 1298 | ||
1303 | snprintf(buf, 30, "Est. remain: %d m", battery_time()); | 1299 | snprintf(buf, 30, "Est. remain: %d m", battery_time()); |
1300 | lcd_puts(0, 6, buf); | ||
1301 | |||
1302 | #ifdef HAVE_CHARGE_CTRL | ||
1303 | snprintf(buf, 30, "Trickle sec: %d/60", trickle_sec); | ||
1304 | lcd_puts(0, 7, buf); | 1304 | lcd_puts(0, 7, buf); |
1305 | #endif | ||
1305 | break; | 1306 | break; |
1306 | } | 1307 | } |
1307 | 1308 | ||