nico@215: nico@215:
nico@215:00001 /* nico@215: 00002 This file is part of CanFestival, a library implementing CanOpen Stack. nico@215: 00003 nico@215: 00004 Copyright (C): Edouard TISSERANT and Francis DUPIN nico@215: 00005 nico@215: 00006 See COPYING file for copyrights details. nico@215: 00007 nico@215: 00008 This library is free software; you can redistribute it and/or nico@215: 00009 modify it under the terms of the GNU Lesser General Public nico@215: 00010 License as published by the Free Software Foundation; either nico@215: 00011 version 2.1 of the License, or (at your option) any later version. nico@215: 00012 nico@215: 00013 This library is distributed in the hope that it will be useful, nico@215: 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of nico@215: 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU nico@215: 00016 Lesser General Public License for more details. nico@215: 00017 nico@215: 00018 You should have received a copy of the GNU Lesser General Public nico@215: 00019 License along with this library; if not, write to the Free Software nico@215: 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA nico@215: 00021 */ nico@215: 00022 nico@215: 00023 /* nico@215: 00024 Functions called by interrupts vectors. nico@215: 00025 */ nico@215: 00026 /* nico@215: 00027 This is a part of the driver, of course ! nico@215: 00028 But you have to put your code in this functions, nico@215: 00029 if you plan to use interruptions. nico@215: 00030 */ nico@215: 00031 nico@215: 00032 #include "../include/data.h" nico@215: 00033 #include "../include/hcs12/applicfg.h" nico@215: 00034 #include "../include/hcs12/error.h" nico@215: 00035 #include "../include/hcs12/candriver.h" nico@215: 00036 #include "../include/hcs12/asm-m68hc12/regs.h" nico@215: 00037 #include "../include/hcs12/asm-m68hc12/portsaccess.h" nico@215: 00038 #include "../include/hcs12/asm-m68hc12/ports_def.h" nico@215: 00039 #include "../include/hcs12/asm-m68hc12/ports.h" nico@215: 00040 #include "../include/hcs12/interrupt.h" nico@215: 00041 etisserant@240: 00042 extern volatile char msgRecu; etisserant@240: 00043 extern volatile Message canMsgRcv; nico@215: 00044 nico@215: 00045 nico@215: 00046 nico@215: 00047 /* Inhibe les interruptions */ nico@215: 00048 etisserant@240: 00049 void lock (void) nico@215: 00050 { nico@215: 00051 unsigned short mask; etisserant@240: 00052 __asm__ __volatile__ ("tpa\n\tsei" : "=d"(mask)); nico@215: 00053 nico@215: 00054 } nico@215: 00055 nico@215: 00056 /* Autorise les interruptions */ etisserant@240: 00057 void unlock (void) nico@215: 00058 { etisserant@240: 00059 __asm__ __volatile__ ("cli"); nico@215: 00060 } nico@215: 00061 nico@215: 00062 nico@215: 00063 nico@215: 00064 etisserant@240: