mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-24 12:19:21 +01:00
code consolidation betweeen mini and loader: utils
This commit is contained in:
parent
c67fab3f57
commit
ba942c27af
5
utils.c
5
utils.c
@ -24,8 +24,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
#include "vsprintf.h"
|
#include "vsprintf.h"
|
||||||
#include "start.h"
|
#include "start.h"
|
||||||
|
#include "gpio.h"
|
||||||
#include "hollywood.h"
|
#include "hollywood.h"
|
||||||
|
|
||||||
|
#ifndef LOADER
|
||||||
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 '.';
|
||||||
@ -49,6 +51,7 @@ void hexdump(void *d, int len) {
|
|||||||
gecko_printf("\n");
|
gecko_printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void udelay(u32 d)
|
void udelay(u32 d)
|
||||||
{
|
{
|
||||||
@ -76,8 +79,10 @@ void panic(u8 v)
|
|||||||
{
|
{
|
||||||
while(1) {
|
while(1) {
|
||||||
debug_output(v);
|
debug_output(v);
|
||||||
|
set32(HW_GPIO1BOUT, GP_SLOTLED);
|
||||||
udelay(500000);
|
udelay(500000);
|
||||||
debug_output(0);
|
debug_output(0);
|
||||||
|
clear32(HW_GPIO1BOUT, GP_SLOTLED);
|
||||||
udelay(500000);
|
udelay(500000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user