summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootloader/main-pp.c7
-rw-r--r--firmware/core_alloc.c19
2 files changed, 21 insertions, 5 deletions
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 08b5ea3ef5..8357b2fff6 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -51,6 +51,9 @@
51#if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) 51#if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200)
52#include "usb_drv.h" 52#include "usb_drv.h"
53#endif 53#endif
54#if defined(SANSA_E200) && defined(HAVE_BOOTLOADER_USB_MODE)
55#include "core_alloc.h"
56#endif
54#if defined(SAMSUNG_YH925) 57#if defined(SAMSUNG_YH925)
55/* this function (in lcd-yh925.c) resets the screen orientation for the OF 58/* this function (in lcd-yh925.c) resets the screen orientation for the OF
56 * for use with dualbooting */ 59 * for use with dualbooting */
@@ -232,7 +235,6 @@ static int handle_usb(int connect_timeout)
232 usb = USB_HANDLED; 235 usb = USB_HANDLED;
233 usb_acknowledge(SYS_USB_CONNECTED_ACK); 236 usb_acknowledge(SYS_USB_CONNECTED_ACK);
234 usb_wait_for_disconnect(&q); 237 usb_wait_for_disconnect(&q);
235 break;
236 } 238 }
237 239
238 if (connect_timeout != TIMEOUT_BLOCK && 240 if (connect_timeout != TIMEOUT_BLOCK &&
@@ -299,6 +301,9 @@ void* main(void)
299 int usb = USB_EXTRACTED; 301 int usb = USB_EXTRACTED;
300 302
301 system_init(); 303 system_init();
304#if defined(SANSA_E200) && defined(HAVE_BOOTLOADER_USB_MODE)
305 core_allocator_init();
306#endif
302 kernel_init(); 307 kernel_init();
303 308
304#ifdef HAVE_BOOTLOADER_USB_MODE 309#ifdef HAVE_BOOTLOADER_USB_MODE
diff --git a/firmware/core_alloc.c b/firmware/core_alloc.c
index df1b4d3213..bf2f8e8298 100644
--- a/firmware/core_alloc.c
+++ b/firmware/core_alloc.c
@@ -8,16 +8,27 @@
8/* not static so it can be discovered by core_get_data() */ 8/* not static so it can be discovered by core_get_data() */
9struct buflib_context core_ctx; 9struct buflib_context core_ctx;
10 10
11/* defined in linker script */
12#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(__PCTOOL__) 11#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(__PCTOOL__)
12
13#if defined(IPOD_VIDEO) && !defined(BOOTLOADER) 13#if defined(IPOD_VIDEO) && !defined(BOOTLOADER)
14/* defined in linker script */
15extern unsigned char audiobuffer[];
14extern unsigned char *audiobufend_lds[]; 16extern unsigned char *audiobufend_lds[];
17/* pointer to end of audio buffer filled at runtime allocator_init */
15unsigned char *audiobufend; 18unsigned char *audiobufend;
16#else /* !IPOD_VIDEO */ 19#elif defined(SANSA_E200) && defined(HAVE_BOOTLOADER_USB_MODE)
17extern unsigned char audiobufend[]; 20/* defined in linker script */
18#endif 21extern unsigned char freebuffer[];
22extern unsigned char freebufferend[];
23/* map linker symbol to the audiobuffer in order to use core_alloc */
24unsigned char *audiobuffer = (unsigned char *)freebuffer;
25unsigned char *audiobufend = (unsigned char *)freebufferend;
26#else /* !IPOD_VIDEO, !SANSA_E200&&BOOTLOADERUSB */
19/* defined in linker script */ 27/* defined in linker script */
20extern unsigned char audiobuffer[]; 28extern unsigned char audiobuffer[];
29extern unsigned char audiobufend[];
30#endif
31
21#else /* PLATFORM_HOSTED */ 32#else /* PLATFORM_HOSTED */
22static unsigned char audiobuffer[((MEMORYSIZE)*1024-768)*1024]; 33static unsigned char audiobuffer[((MEMORYSIZE)*1024-768)*1024];
23unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer); 34unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer);