additional define to disable all usbgecko support

This commit is contained in:
dhewg 2010-07-09 02:37:33 +02:00
parent f742371e9e
commit 026b1ccdfc
5 changed files with 18 additions and 3 deletions

View File

@ -1,5 +1,7 @@
include starlet.mk include starlet.mk
# enabled usbgecko support
CFLAGS += -DCAN_HAZ_USBGECKO
# disables debug spew over usbgecko # disables debug spew over usbgecko
#CFLAGS += -DNDEBUG #CFLAGS += -DNDEBUG
# enables LFCR linefeeds for usbgecko output, useful for some terminal apps # enables LFCR linefeeds for usbgecko output, useful for some terminal apps

View File

@ -217,7 +217,7 @@ int boot2_load(int copy)
memset(boot2_iv, 0, 16); memset(boot2_iv, 0, 16);
memcpy(boot2_iv, &tmd.contents.index, 2); //just zero anyway... memcpy(boot2_iv, &tmd.contents.index, 2); //just zero anyway...
#ifndef NDEBUG #if defined(CAN_HAZ_USBGECKO) && !defined(NDEBUG)
u32 *kp = (u32*)boot2_key; u32 *kp = (u32*)boot2_key;
gecko_printf("boot2 title key: %08x%08x%08x%08x\n", kp[0], kp[1], kp[2], kp[3]); gecko_printf("boot2 title key: %08x%08x%08x%08x\n", kp[0], kp[1], kp[2], kp[3]);
#endif #endif

View File

@ -10,6 +10,7 @@ Copyright (C) 2009 Andre Heider "dhewg" <dhewg@wiibrew.org>
# This code is licensed to you under the terms of the GNU GPL, version 2; # This code is licensed to you under the terms of the GNU GPL, version 2;
# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/ */
#ifdef CAN_HAZ_USBGECKO
#include "types.h" #include "types.h"
#include "irq.h" #include "irq.h"
@ -386,3 +387,5 @@ cleanup:
_gecko_state = GECKO_STATE_NONE; _gecko_state = GECKO_STATE_NONE;
} }
#endif

10
gecko.h
View File

@ -14,6 +14,8 @@ Copyright (C) 2009 Andre Heider "dhewg" <dhewg@wiibrew.org>
#ifndef __GECKO_H__ #ifndef __GECKO_H__
#define __GECKO_H__ #define __GECKO_H__
#ifdef CAN_HAZ_USBGECKO
#include "types.h" #include "types.h"
void gecko_init(void); void gecko_init(void);
@ -28,5 +30,13 @@ int gecko_printf(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
void gecko_timer_initialize(void); void gecko_timer_initialize(void);
void gecko_timer(void); void gecko_timer(void);
#else
#define gecko_init(...) do { } while(0)
#define gecko_enable_console(...) do { } while(0)
#define gecko_printf(...) do { } while(0)
#define gecko_timer_initialize(...) do { } while(0)
#define gecko_timer(...) do { } while(0)
#endif
#endif #endif

View File

@ -18,7 +18,7 @@ Copyright (C) 2008, 2009 Hector Martin "marcan" <marcan@marcansoft.com>
#include <stdarg.h> #include <stdarg.h>
#if !defined(LOADER) && !defined(NDEBUG) #if defined(CAN_HAZ_USBGECKO) && !defined(LOADER) && !defined(NDEBUG)
static char ascii(char s) { static char ascii(char s) {
if(s < 0x20) return '.'; if(s < 0x20) return '.';
if(s > 0x7E) return '.'; if(s > 0x7E) return '.';
@ -42,6 +42,7 @@ void hexdump(const void *d, int len) {
gecko_printf("\n"); gecko_printf("\n");
} }
} }
#endif
int sprintf(char *buffer, const char *fmt, ...) int sprintf(char *buffer, const char *fmt, ...)
{ {
@ -53,7 +54,6 @@ int sprintf(char *buffer, const char *fmt, ...)
va_end(args); va_end(args);
return i; return i;
} }
#endif
void udelay(u32 d) void udelay(u32 d)
{ {