blob: c2690324e561c6bcb64ef77ef2900b736ad0907b [file] [log] [blame]
Barry Wardell84b509d2007-01-28 18:42:11 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: main.c 11997 2007-01-13 09:08:18Z miipekk $
9 *
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
Dave Chapman582d02d2007-03-06 09:11:22 +000020#include <stdbool.h>
21
Barry Wardell84b509d2007-01-28 18:42:11 +000022/* Error codes */
23#define EOK 0
24#define EFILE_NOT_FOUND -1
25#define EREAD_CHKSUM_FAILED -2
26#define EREAD_MODEL_FAILED -3
27#define EREAD_IMAGE_FAILED -4
28#define EBAD_CHKSUM -5
29#define EFILE_TOO_BIG -6
Barry Wardell14ed3ca2007-03-16 14:28:00 +000030#define EINVALID_FORMAT -7
Barry Wardell84b509d2007-01-28 18:42:11 +000031
Dave Chapman4d25bff2007-03-05 23:56:28 +000032/* Set this to true to enable lcd_update() in the printf function */
33extern bool verbose;
34
Barry Wardell23709982007-03-12 22:12:20 +000035/* Error types */
36#define EATA -1
37#define EDISK -2
38#define EBOOTFILE -3
39
Barry Wardell84b509d2007-01-28 18:42:11 +000040/* Functions common to all bootloaders */
41void reset_screen(void);
42void printf(const char *format, ...);
43char *strerror(int error);
Barry Wardell23709982007-03-12 22:12:20 +000044void error(int errortype, int error);
Barry Wardell84b509d2007-01-28 18:42:11 +000045int load_firmware(unsigned char* buf, char* firmware, int buffer_size);
46int load_raw_firmware(unsigned char* buf, char* firmware, int buffer_size);