mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
Avoid ifdefs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26908 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fe47966f0e
commit
8260a79689
2 changed files with 16 additions and 16 deletions
|
|
@ -395,10 +395,10 @@ int usb_drv_recv(int ep, void *ptr, int len)
|
||||||
endpoints[ep][1].len = len;
|
endpoints[ep][1].len = len;
|
||||||
endpoints[ep][1].rc = -1;
|
endpoints[ep][1].rc = -1;
|
||||||
|
|
||||||
#ifndef BOOTLOADER
|
|
||||||
/* remove data buffer from cache */
|
/* remove data buffer from cache */
|
||||||
invalidate_dcache();
|
if (!is_bootloader()) /* bootloader is running uncached */
|
||||||
#endif
|
invalidate_dcache();
|
||||||
|
|
||||||
/* DMA setup */
|
/* DMA setup */
|
||||||
uc_desc->status = USB_DMA_DESC_BS_HST_RDY |
|
uc_desc->status = USB_DMA_DESC_BS_HST_RDY |
|
||||||
USB_DMA_DESC_LAST |
|
USB_DMA_DESC_LAST |
|
||||||
|
|
@ -447,10 +447,9 @@ void ep_send(int ep, void *ptr, int len)
|
||||||
endpoints[ep][0].len = len;
|
endpoints[ep][0].len = len;
|
||||||
endpoints[ep][0].rc = -1;
|
endpoints[ep][0].rc = -1;
|
||||||
|
|
||||||
#ifndef BOOTLOADER
|
|
||||||
/* Make sure data is committed to memory */
|
/* Make sure data is committed to memory */
|
||||||
clean_dcache();
|
if (!is_bootloader()) /* bootloader is running uncached */
|
||||||
#endif
|
clean_dcache();
|
||||||
|
|
||||||
logf("xx%s\n", make_hex(ptr, len));
|
logf("xx%s\n", make_hex(ptr, len));
|
||||||
|
|
||||||
|
|
@ -549,21 +548,16 @@ static void handle_out_ep(int ep)
|
||||||
if (ep_sts & USB_EP_STAT_OUT_RCVD) {
|
if (ep_sts & USB_EP_STAT_OUT_RCVD) {
|
||||||
int dma_sts = uc_desc->status;
|
int dma_sts = uc_desc->status;
|
||||||
int dma_len = dma_sts & 0xffff;
|
int dma_len = dma_sts & 0xffff;
|
||||||
#ifdef LOGF_ENABLE
|
|
||||||
int dma_frm = (dma_sts >> 16) & 0x7ff;
|
|
||||||
int dma_mst = dma_sts & 0xf8000000;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(dma_sts & USB_DMA_DESC_ZERO_LEN)) {
|
if (!(dma_sts & USB_DMA_DESC_ZERO_LEN)) {
|
||||||
logf("EP%d OUT token, st:%08x len:%d frm:%x data=%s epstate=%d\n", ep,
|
logf("EP%d OUT token, st:%08x len:%d frm:%x data=%s epstate=%d\n",
|
||||||
dma_mst, dma_len, dma_frm, make_hex(uc_desc->data_ptr, dma_len),
|
ep, dma_sts & 0xf8000000, dma_len, (dma_sts >> 16) & 0x7ff,
|
||||||
endpoints[ep][1].state);
|
make_hex(uc_desc->data_ptr, dma_len), endpoints[ep][1].state);
|
||||||
#ifndef BOOTLOADER
|
|
||||||
/*
|
/*
|
||||||
* If parts of the just dmaed range are in cache, dump them now.
|
* If parts of the just dmaed range are in cache, dump them now.
|
||||||
*/
|
*/
|
||||||
dump_dcache_range(uc_desc->data_ptr, dma_len);
|
if (!is_bootloader()) /* bootloader is running uncached */
|
||||||
#endif
|
dump_dcache_range(uc_desc->data_ptr, dma_len);
|
||||||
} else{
|
} else{
|
||||||
logf("EP%d OUT token, st:%08x frm:%x (no data)\n", ep,
|
logf("EP%d OUT token, st:%08x frm:%x (no data)\n", ep,
|
||||||
dma_mst, dma_frm);
|
dma_mst, dma_frm);
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,12 @@
|
||||||
|
|
||||||
#include "as3525.h"
|
#include "as3525.h"
|
||||||
|
|
||||||
|
#ifdef BOOTLOADER
|
||||||
|
#define is_bootloader() 1
|
||||||
|
#else
|
||||||
|
#define is_bootloader() 0
|
||||||
|
#endif /* BOOTLOADER */
|
||||||
|
|
||||||
#define USB_NUM_EPS 4
|
#define USB_NUM_EPS 4
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue