include_HEADERS = hal_machperiph.h
-mach_hal_SOURCES = hal.c startup.c hal_machperiph.c
+mach_hal_SOURCES = hal.c startup.c hal_machperiph.c hal_reserve_usb_ram.c
void lpc_watchdog_init(int on,int timeout_ms);
void lpc_watchdog_feed();
+void *lpc_reserve_usb_ram(unsigned long size);
#endif /* _HAL_MACHPERIPH_H */
--- /dev/null
+#include <stdint.h>
+#include <string.h>
+#include <hal_machperiph.h>
+
+extern char _eusbram;
+
+void *lpc_reserve_usb_ram(unsigned long size)
+{
+ static char *usb_ram_avail=&_eusbram;
+ char *prev_avail;
+
+ /*printf("usb reserve %lu at 0x%lx\n",size,(unsigned long)usb_ram_avail);*/
+
+ if(!usb_ram_avail)
+ return NULL;
+
+ prev_avail=(char *)(((uintptr_t)usb_ram_avail+3)&~3);
+ usb_ram_avail=prev_avail+size;
+
+ return prev_avail;
+}
\ No newline at end of file
#ifdef ULD_DEFAULT_BUFFER_SIZE
#undef ULD_DEFAULT_BUFFER_SIZE
- #define ULD_DEFAULT_BUFFER_SIZE 0x0800
+ #define ULD_DEFAULT_BUFFER_SIZE 0x2000
#endif
#define UL_DRV_SYSLESS_PORT UART1_BASE
/******************************************/
/* This used for USB RAM section */
- .usb_ram (NOLOAD):
+ .usbram (NOLOAD):
{
- *.o (USB_RAM)
+ _usbram = . ;
+ *(.usbram)
+ . = ALIGN(4);
+ _eusbram = . ;
+ _usbram_end = . ;
} > IRAM1
/******************************************/
/******************************************/
/* This used for USB RAM section */
- .usb_ram (NOLOAD):
+ .usbram (NOLOAD):
{
- *.o (USB_RAM)
+ _usbram = . ;
+ *(.usbram)
+ . = ALIGN(4);
+ _eusbram = . ;
+ _usbram_end = . ;
} > IRAM1
/******************************************/