summaryrefslogtreecommitdiffstats
path: root/bootloader/ipodnano2g.c
blob: f6bfe148ac22c6fbee9f3433a97f416d4b74c133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id$
 *
 * Copyright (C) 2009 by Dave Chapman
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>

#include "config.h"

#include "inttypes.h"
#include "cpu.h"
#include "system.h"
#include "lcd.h"
#include "i2c-s5l8700.h"
#include "kernel.h"
#include "thread.h"
#include "storage.h"
#include "fat.h"
#include "disk.h"
#include "font.h"
#include "backlight.h"
#include "backlight-target.h"
#include "button.h"
#include "panic.h"
#include "power.h"
#include "file.h"
#include "common.h"

char version[] = APPSVERSION;

/* Show the Rockbox logo - in show_logo.c */
extern int show_logo(void);

extern int line;

void main(void)
{
    int i;

    system_init();
    i2c_init();
    kernel_init();

    enable_irq();

    lcd_init();

    _backlight_init();

    lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---");
    verbose = 0;
    i = 0;
    while (!button_hold()) {
        line = 1;

        printf("i=%d",i++);
        printf("TBCNT:   %08x",TBCNT);
        printf("GPIO  0: %08x",PDAT0);
        printf("GPIO  1: %08x",PDAT1);
        printf("GPIO  2: %08x",PDAT2);
        printf("GPIO  3: %08x",PDAT3);
        printf("GPIO  4: %08x",PDAT4);
        printf("GPIO  5: %08x",PDAT5);
        printf("GPIO  6: %08x",PDAT6);
        printf("GPIO  7: %08x",PDAT7);
        printf("GPIO 10: %08x",PDAT10);
        printf("GPIO 11: %08x",PDAT11);
        printf("GPIO 13: %08x",PDAT13);
        printf("GPIO 14: %08x",PDAT14);

        lcd_update();
    }

    disable_irq();

    /* Branch back to iBugger entry point */
    asm volatile("ldr pc, =0x08640568");

    /* We never reach here */
    while(1);
}