📄 ap-main.h
字号:
//****************************************************************************************
//****************************************************************************************
// Project Name: MMC / SD MEMORY CARD FAT16 & FAT 32 DRIVER
// PIC 18 SAMPLE PROJECT C CODE HEADER FILE
// Copyright: EMBEDDED-CODE.COM
//
// Licenced To: NONE
// Licence Number: NONE
//
// IMPORTANT: These files are copyright of embedded-code.com and are subject to a licence
// agreement. All rights reserved. Unauthorised use, reproduction or distribution of
// these files may lead to prosecution.
// Any use in violation of the licence restrictions may subject the user to criminal
// sanctions under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of the license.
// This software is provided in an "as is" condition. No warranties, whether express,
// implied or statutory, including, but not limited to, implied warranties of
// merchantability and fitness for a particular purpose apply to this software.
// Embedded-code.com shall not be liable in any circumstances for special, incidental
// or consequential damages, for any reason whatsoever.
// Please see 'www.embedded-code.com\licence' or email 'licence@embedded-code.com' for
// full details.
// This file contains hidden markers to identify it uniquely to the licence number it was
// purchased under.
// DO NOT REMOVE THIS NOTICE - IT IS A REQUIREMENT OF THE LICENCE AGREEMENT.
//****************************************************************************************
//****************************************************************************************
//*****************************
//*****************************
//********** DEFINES **********
//*****************************
//*****************************
#ifndef MAIN_C_INIT //(Include this section only once for each source file that includes this header file)
#define MAIN_C_INIT
//------------------------
//----- USER DEFINES -----
//------------------------
//----------------------
//----- IO DEFINES -----
//----------------------
#define LED1_OFF LATBbits.LATB2
#define LED2_OFF LATBbits.LATB3
//--------------------------
//----- SWITCH DEFINES -----
//--------------------------
#define SWITCH_1_PRESSED switches_debounced & 0x01
#define SWITCH_2_PRESSED switches_debounced & 0x02
#define SWITCH_1_NEW_PRESS switches_new & 0x01
#define SWITCH_2_NEW_PRESS switches_new & 0x02
#endif
//*******************************
//*******************************
//********** FUNCTIONS **********
//*******************************
//*******************************
#ifdef MAIN_C
//-----------------------------------
//----- INTERNAL ONLY FUNCTIONS -----
//-----------------------------------
void initialise (void);
void read_switches (void);
void process_mode (void);
void interruptisrh (void);
void interruptisrl (void);
//-----------------------------------------
//----- INTERNAL & EXTERNAL FUNCTIONS -----
//-----------------------------------------
//(Also defined below as extern)
#else
//------------------------------
//----- EXTERNAL FUNCTIONS -----
//------------------------------
#endif
//****************************
//****************************
//********** MEMORY **********
//****************************
//****************************
#ifdef MAIN_C
//--------------------------------------------
//----- INTERNAL ONLY MEMORY DEFINITIONS -----
//--------------------------------------------
BYTE read_switches_flag;
WORD user_mode_10ms_timer;
BYTE force_led1_off_10ms_timer = 0;
BYTE force_led2_off_10ms_timer = 0;
//Inline assembler access bank variables
#pragma udata access acssect //'acssect' is the section label
near BYTE asm_irq_temp; //'near' qualifier specifies access RAM
near BYTE asm_irq_temp1;
#pragma udata //(Return to normal)
//--------------------------------------------------
//----- INTERNAL & EXTERNAL MEMORY DEFINITIONS -----
//--------------------------------------------------
//(Also defined below as extern)
BYTE switches_debounced = 0;
BYTE switches_new = 0;
WORD general_use_10ms_timer;
WORD general_use_100ms_timer;
#else
//---------------------------------------
//----- EXTERNAL MEMORY DEFINITIONS -----
//---------------------------------------
extern BYTE switches_debounced;
extern BYTE switches_new;
extern WORD general_use_10ms_timer;
extern WORD general_use_100ms_timer;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -