From abedf371a610485c3de77af2a05e2699627ff358 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Wed, 22 Jun 2011 07:48:01 +0800 Subject: more refactoring, moved platform specific includes to debug_runlooptasks.h --- Debugger/debug_comm.S | 1 - Debugger/debug_comm.h | 53 -------------------------------------- Debugger/debug_runlooptasks.S | 15 +---------- Debugger/debug_runlooptasks.h | 60 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 68 deletions(-) delete mode 100644 Debugger/debug_comm.h create mode 100644 Debugger/debug_runlooptasks.h diff --git a/Debugger/debug_comm.S b/Debugger/debug_comm.S index d0ea213..e237999 100644 --- a/Debugger/debug_comm.S +++ b/Debugger/debug_comm.S @@ -17,7 +17,6 @@ #include "debug_macros.h" #include "debug_stub.h" #include "debug_internals.h" -#include "debug_comm.h" .extern dbg__sendCommMsg diff --git a/Debugger/debug_comm.h b/Debugger/debug_comm.h deleted file mode 100644 index 7553240..0000000 --- a/Debugger/debug_comm.h +++ /dev/null @@ -1,53 +0,0 @@ -/** @file debug_comm.h - * @brief Shared C/ASM header file for debugger communications - * - */ - -/* Copyright (C) 2007-2010 the NxOS developers - * - * Module Developed by: TC Wan - * - * See AUTHORS for a full list of the developers. - * - * See COPYING for redistribution license - * - */ - -#ifndef __DEBUG_COMM_H__ -#define __DEBUG_COMM_H__ - -#include "_c_arm_macros.h" - -/* This is a place holder header file to allow for interfacing with C Routines in either - * NxOS or NXT Firmware. - * - * Since the header files from the original source trees were meant for C programs, we can't - * include them directly. Here we just use .extern to reference the routines. - */ - -#ifdef __NXOS__ - - .extern nx_usb_is_connected - .extern nx_usb_can_write - .extern nx_usb_write - .extern nx_usb_data_written - .extern nx_usb_read - .extern nx_usb_data_read - -#else /* NXT Firmware */ - - .extern cCommInit - .extern cCommCtrl - .extern cCommExit - .extern dUsbWrite - .extern dUsbRead - .extern dUsbIsConfigured - .extern dBtSendMsg - .equ nxt_UBYTE_TRUE, 1 - .equ nxt_UBYTE_FALSE, 0 - .equ USB_CMD_READY, 0x01 /* From c_comm.iom */ - .equ BT_CMD_READY, 0x02 /* From c_comm.iom */ - -#endif - -#endif diff --git a/Debugger/debug_runlooptasks.S b/Debugger/debug_runlooptasks.S index 4115ad6..75c477c 100644 --- a/Debugger/debug_runlooptasks.S +++ b/Debugger/debug_runlooptasks.S @@ -70,6 +70,7 @@ #define __ASSEMBLY__ #define REBOOT_POWERDOWN +#include "debug_runlooptasks.h" #include "debug_internals.h" #include "debug_macros.h" @@ -97,8 +98,6 @@ dbg__runloopTasks: * NXT Firmware Run Loop * ****************************************************************************/ - .extern cCommCtrl - dbg__runloopTasks: push {lr} /* FIXME: Add necessary cXXXCtrl calls here */ @@ -108,7 +107,6 @@ dbg__runloopTasks: #endif #ifdef __NXOS__ - .extern nx_core_reset /**************************************************************************** * * NxOS Reboot Routine @@ -118,11 +116,6 @@ dbg__runloopTasks: b nx_core_reset /* Reboot Brick, won't return */ #else - .extern dIOCtrlSetPower - .extern dIOCtrlSetPwm - .extern dIOCtrlTransfer - .equ BOOT, 0xA55A - .equ POWERDOWN, 0x5A00 /**************************************************************************** * * NXT Firmware Reboot Routine @@ -171,9 +164,6 @@ _dbg__reboot_wait: #ifdef __NXOS__ .extern debug_OutCommBuf - .extern nx_usb_is_connected - .extern nx_usb_write - .extern nx_usb_data_written /**************************************************************************** * * NxOS Communications Driver Interface Routine @@ -215,9 +205,6 @@ exit_dbg__sendCommMsg: #else - .extern dBtSendMsg - .extern dUsbIsConfigured - .extern dUsbWrite /**************************************************************************** * * NXT Firmware Communications Driver Interface Routine diff --git a/Debugger/debug_runlooptasks.h b/Debugger/debug_runlooptasks.h new file mode 100644 index 0000000..360e0d1 --- /dev/null +++ b/Debugger/debug_runlooptasks.h @@ -0,0 +1,60 @@ +/** @file debug_runlooptasks.h + * @brief Shared C/ASM header file for debugger communications + * + */ + +/* Copyright (C) 2007-2011 the NxOS developers + * + * Module Developed by: TC Wan + * + * See AUTHORS for a full list of the developers. + * + * See COPYING for redistribution license + * + */ + +#ifndef __DEBUG_RUNLOOPTASKS_H__ +#define __DEBUG_RUNLOOPTASKS_H__ + +#include "_c_arm_macros.h" + +/* This is a place holder header file to allow for interfacing with C Routines in either + * NxOS or NXT Firmware. + * + * Since the header files from the original source trees were meant for C programs, we can't + * include them directly. Here we just use .extern to reference the routines. + */ + +#ifdef __NXOS__ + + .extern nx_usb_is_connected + .extern nx_usb_can_write + .extern nx_usb_write + .extern nx_usb_data_written + .extern nx_usb_read + .extern nx_usb_data_read + .extern nx_core_reset + +#else /* NXT Firmware */ + + .extern cCommInit + .extern cCommCtrl + .extern cCommExit + .extern dUsbWrite + .extern dUsbRead + .extern dUsbIsConfigured + .extern dBtSendMsg + .equ nxt_UBYTE_TRUE, 1 + .equ nxt_UBYTE_FALSE, 0 + .equ USB_CMD_READY, 0x01 /* From c_comm.iom */ + .equ BT_CMD_READY, 0x02 /* From c_comm.iom */ + + .extern dIOCtrlSetPower + .extern dIOCtrlSetPwm + .extern dIOCtrlTransfer + .equ BOOT, 0xA55A /* from c_ioctrl.iom */ + .equ POWERDOWN, 0x5A00 /* from c_ioctrl.iom */ + +#endif + +#endif -- cgit v1.2.3