📄 main.h
字号:
/******************************************************************************
* Filename : main.h *
* Program : loader. *
* Copyright : Copyright (C) 2001, Young-Su, Ahn. *
* Author : Young-Su, Ahn <nurie@dreamwiz.com> *
* Description : Header file for main.c, Set environment of loader. *
* Created at : Wed Mar 13 2001. *
* Based on : blob-1.0.8-pre2 (http://www.lart.tudelft.nl) *
* Modified by : *
* Modified at : *
******************************************************************************/
/* 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 program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _MAIN_H_465241632646492421432
#define _MAIN_H_465241632646492421432
#include "types.h"
#include "config.h"
#include "time.h"
#include "serial.h"
#include "lstring.h"
//#include "command.h"
#define ADDR32(A) (*((volatile ulong *)(A)))
#define ADDR16(A) (*((volatile ushort *)(A)))
#define ADDR8(A) (*((volatile uchar *)(A)))
typedef struct {
long terminalSpeed;
long downloadSpeed;
} LOADER_STATUS;
// serial speed.
#define BaudToSCR(A) ((3686400 / (16 * A)) - 1) // SCR : Serial clock rate.
#define SCRToBaud(A) (3686400 / (16 * (A + 1)))
// print out.
/*#define OutputString(A) SerialOutputString(A)
#define OutputByte(A) SerialOutputByte(A)
#define OutputHex(A,B) SerialOutputHex(A, B)
#define OutputDec(A) SerialOutputDec((long) A)
#define InputString(A) SerialInputString(A)
#define InputInt(A) SerialInputDec32(A)
#define InputByte(A) SerialInputByte(A)
*/
// for cpu byte order (big or little endian).
// Byte swapping.
#define SWAP8(A) (A)
#define SWAP16(A) ((((A)&0x00ff)<<8) | ((A)>>8))
#define SWAP32(A) ((((A)&0x000000ff)<<24) | (((A)&0x0000ff00)<<8) | (((A)&0x00ff0000)>>8) | (((A)&0xff000000)>>24))
//#define SWAP8(A) (A)
//#define SWAP16(A) (A)
//#define SWAP32(A) (A)
#define NEWLINE "\n"
extern LOADER_STATUS status;
extern void C_Entry(void);
#endif // end _MAIN_H_465241632646492421432.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -