Move to latest CoOS

This commit is contained in:
bsongis
2015-02-20 19:01:42 +01:00
parent b456b630b5
commit 315934f8d0
35 changed files with 8090 additions and 7253 deletions
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsConfig.h * @file OsConfig.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief This file use by user to configuration CooCox CoOS. * @brief This file use by user to configuration CooCox CoOS.
* @note Ensure you have knew every item before modify this file. * @note Ensure you have knew every item before modify this file.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -37,7 +60,11 @@ Max number of tasks that can be running.
/*!< /*!<
Idle task stack size(word). Idle task stack size(word).
*/ */
#if CFG_CHIP_TYPE == 3
#define CFG_IDLE_STACK_SIZE (58)
#else
#define CFG_IDLE_STACK_SIZE (25) #define CFG_IDLE_STACK_SIZE (25)
#endif
/*!< /*!<
System frequency (Hz). System frequency (Hz).
+27 -4
View File
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file CoOS.h * @file CoOS.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief API header file of CooCox CoOS. * @brief API header file of CooCox CoOS.
* @details This file including all API functions's declare of CooCox CoOS. * @details This file including all API functions's declare of CooCox CoOS.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+28 -5
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsCore.h * @file OsCore.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Header file related to kernel * @brief Header file related to kernel
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -20,7 +43,7 @@
#include <CoOS.h> #include <CoOS.h>
#define OsSchedLock() { OSSchedLock++; asm volatile ("" : : : "memory"); } /*!< Lock schedule */ #define OsSchedLock() OSSchedLock++; /*!< Lock schedule */
extern void OsSchedUnlock(void); extern void OsSchedUnlock(void);
#endif #endif
+27 -4
View File
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsError.h * @file OsError.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief rror dispose header file * @brief rror dispose header file
* @details This file use to dispose error which from error configure for OS. * @details This file use to dispose error which from error configure for OS.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsEvent.h * @file OsEvent.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Event management header file * @brief Event management header file
* @details This file including some defines and declares related to event * @details This file including some defines and declares related to event
* (semaphore,mailbox,queque) management. * (semaphore,mailbox,queque) management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsFlag.h * @file OsFlag.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Evnet flag management header file * @brief Evnet flag management header file
* @details This file including some defines and declares about flag management. * @details This file including some defines and declares about flag management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsKernelHeap.h * @file OsKernelHeap.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Header file related to memory management * @brief Header file related to memory management
* @details This file including some defines and function declare related to * @details This file including some defines and function declare related to
* kernel heap management. * kernel heap management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsMm.h * @file OsMm.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Header file related to memory management * @brief Header file related to memory management
* @details This file including some defines and function declare related to * @details This file including some defines and function declare related to
* memory management. * memory management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsMutex.h * @file OsMutex.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Mutex management header file * @brief Mutex management header file
* @details This file including some defines and declare related to mutex * @details This file including some defines and declare related to mutex
* management. * management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsQueue.h * @file OsQueue.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Queue management header file * @brief Queue management header file
* @details This file including some defines and declares about queue management. * @details This file including some defines and declares about queue management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -2,17 +2,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsServiceReq.h * @file OsServiceReq.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Header file related to service request * @brief Header file related to service request
* @details This file including some defines and function declare related to * @details This file including some defines and function declare related to
* service request. * service request.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsTask.h * @file OsTask.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Header file related to task. * @brief Header file related to task.
* @details This file including some defines and function declare related to task. * @details This file including some defines and function declare related to task.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,16 +1,39 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsTime.c * @file OsTime.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Header file related to time management * @brief Header file related to time management
* @details Thie file including some data declare related to time managment. * @details Thie file including some data declare related to time managment.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsTimer.h * @file OsTimer.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Timer manage header file * @brief Timer manage header file
* @details This file including some declares and defines related to timer * @details This file including some declares and defines related to timer
* management. * management.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+29 -6
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file coocox.h * @file coocox.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Gather for all header file of CooCox CoOS. * @brief Gather for all header file of CooCox CoOS.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -17,8 +40,8 @@
#ifndef _COOCOX_H #ifndef _COOCOX_H
#define _COOCOX_H #define _COOCOX_H
#define OS_VERSION (U16)0x0113 /*!< OS version.(format: Vx.xx), #define OS_VERSION (U16)0x0116 /*!< OS version.(format: Vx.xx),
e.g. value 0x0113 is version V1.13*/ e.g. value 0x0114 is version V1.14*/
/*---------------------------- Include ---------------------------------------*/ /*---------------------------- Include ---------------------------------------*/
#include "CoOS.h" #include "CoOS.h"
#include "OsArch.h" #include "OsArch.h"
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file core.c * @file core.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Core implementation code of CooCox CoOS kernel. * @brief Core implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+38 -13
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file event.c * @file event.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief event management implementation code of CooCox CoOS kernel. * @brief event management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -323,30 +346,32 @@ void EventTaskToRdy(P_ECB pecb)
{ {
RemoveDelayList(ptcb); /* Yes,remove task from DELAY list */ RemoveDelayList(ptcb); /* Yes,remove task from DELAY list */
} }
#if CFG_MAILBOX_EN >0
if(pecb->eventType == EVENT_TYPE_MBOX)/* Is it a mailbox event? */ if(pecb->eventType == EVENT_TYPE_MBOX)/* Is it a mailbox event? */
{ {
ptcb->pmail = pecb->eventPtr; /* Yes,send mail to task */ ptcb->pmail = pecb->eventPtr; /* Yes,send mail to task */
pecb->eventPtr = Co_NULL; /* Clear event sign */ pecb->eventPtr = Co_NULL; /* Clear event sign */
pecb->eventCounter--; //pecb->eventCounter--;
} }
#endif
#if CFG_QUEUE_EN >0 #if CFG_QUEUE_EN >0
else if(pecb->eventType == EVENT_TYPE_QUEUE) /* Is it a queue event? */ else if(pecb->eventType == EVENT_TYPE_QUEUE) /* Is it a queue event? */
{ {
pqcb = (P_QCB)pecb->eventPtr; /* Yes,get queue pointer */ pqcb = (P_QCB)pecb->eventPtr; /* Yes,get queue pointer */
ptcb->pmail = *(pqcb->qStart + pqcb->head); /* Send mail to task */ ptcb->pmail = *(pqcb->qStart + pqcb->head); /* Send mail to task */
pqcb->head++; /* Clear event sign */ //pqcb->head++; /* Clear event sign */
pqcb->qSize--; //pqcb->qSize--;
if(pqcb->head == pqcb->qMaxSize) //if(pqcb->head == pqcb->qMaxSize)
{ //{
pqcb->head = 0; // pqcb->head = 0;
} //}
} }
#endif #endif
#if CFG_MAILBOX_EN >0 #if CFG_SEM_EN >0
else if(pecb->eventType == EVENT_TYPE_SEM)/* Is it a semaphore event? */ else if(pecb->eventType == EVENT_TYPE_SEM)/* Is it a semaphore event? */
{ {
pecb->eventCounter--; /* Yes,clear event sign */ //pecb->eventCounter--; /* Yes,clear event sign */
ptcb->pmail = (void*)0xffffffff; /* Indicate task woke by event */ ptcb->pmail = (void*)0xffffffff; /* Indicate task woke by event */
} }
#endif #endif
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file flag.c * @file flag.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Flag management implementation code of coocox CoOS kernel. * @brief Flag management implementation code of coocox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file hook.c * @file hook.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief hook management implementation code of CooCox CoOS kernel. * @brief hook management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file kernelHeap.c * @file kernelHeap.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief kernel heap management implementation code of CooCox CoOS kernel. * @brief kernel heap management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+35 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file mbox.c * @file mbox.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Mailbox management implementation code of CooCox CoOS kernel. * @brief Mailbox management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -208,8 +231,11 @@ void* CoPendMail(OS_EventID id,U32 timeout,StatusType* perr)
*perr = E_OK; *perr = E_OK;
/* Have recived a message or the mailbox have been deleted */ /* Have recived a message or the mailbox have been deleted */
OsSchedLock();
pmail = curTCB->pmail; pmail = curTCB->pmail;
pecb->eventCounter = 0;
curTCB->pmail = Co_NULL; curTCB->pmail = Co_NULL;
OsSchedUnlock();
return pmail; /* Return received message or Co_NULL */ return pmail; /* Return received message or Co_NULL */
} }
else /* If time-out is configured */ else /* If time-out is configured */
@@ -228,8 +254,13 @@ void* CoPendMail(OS_EventID id,U32 timeout,StatusType* perr)
else /* Have recived a message or the mailbox have been deleted*/ else /* Have recived a message or the mailbox have been deleted*/
{ {
*perr = E_OK; *perr = E_OK;
OsSchedLock();
pmail = curTCB->pmail; pmail = curTCB->pmail;
pecb->eventCounter = 0;
curTCB->pmail = Co_NULL; curTCB->pmail = Co_NULL;
OsSchedUnlock();
return pmail; /* Return received message or Co_NULL */ return pmail; /* Return received message or Co_NULL */
} }
} }
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file mm.c * @file mm.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief memory management implementation code of CooCox CoOS kernel. * @brief memory management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file mutex.c * @file mutex.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Mutex management implementation code of CooCox CoOS kernel. * @brief Mutex management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+43 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file queue.c * @file queue.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Queue management implementation code of CooCox CoOS kernel. * @brief Queue management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -267,8 +290,16 @@ void* CoPendQueueMail(OS_EventID id,U32 timeout,StatusType* perr)
EventTaskToWait(pecb,curTCB); EventTaskToWait(pecb,curTCB);
/* Have recived message or the queue have been deleted */ /* Have recived message or the queue have been deleted */
OsSchedLock();
pmail = curTCB->pmail; pmail = curTCB->pmail;
curTCB->pmail = Co_NULL; curTCB->pmail = Co_NULL;
pqcb->head++; /* Clear event sign */
pqcb->qSize--;
if(pqcb->head == pqcb->qMaxSize)
{
pqcb->head = 0;
}
OsSchedUnlock();
*perr = E_OK; *perr = E_OK;
return pmail; /* Return message received or Co_NULL */ return pmail; /* Return message received or Co_NULL */
} }
@@ -287,8 +318,16 @@ void* CoPendQueueMail(OS_EventID id,U32 timeout,StatusType* perr)
} }
else /* If event occured */ else /* If event occured */
{ {
OsSchedLock();
pmail = curTCB->pmail; pmail = curTCB->pmail;
curTCB->pmail = Co_NULL; curTCB->pmail = Co_NULL;
pqcb->head++; /* Clear event sign */
pqcb->qSize--;
if(pqcb->head == pqcb->qMaxSize)
{
pqcb->head = 0;
}
OsSchedUnlock();
*perr = E_OK; *perr = E_OK;
return pmail; /* Return message received or Co_NULL */ return pmail; /* Return message received or Co_NULL */
} }
+33 -8
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file sem.c * @file sem.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Semaphore management implementation code of CooCox CoOS kernel. * @brief Semaphore management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -136,8 +159,8 @@ StatusType CoAcceptSem(OS_EventID id)
OsSchedLock(); OsSchedLock();
if(pecb->eventCounter > 0) /* If semaphore is positive,resource available */ if(pecb->eventCounter > 0) /* If semaphore is positive,resource available */
{ {
OsSchedUnlock();
pecb->eventCounter--; /* Decrement semaphore only if positive */ pecb->eventCounter--; /* Decrement semaphore only if positive */
OsSchedUnlock();
return E_OK; return E_OK;
} }
else /* Resource is not available */ else /* Resource is not available */
@@ -203,18 +226,17 @@ StatusType CoPendSem(OS_EventID id,U32 timeout)
} }
else /* Resource is not available */ else /* Resource is not available */
{ {
OsSchedUnlock();
curTCB = TCBRunning; curTCB = TCBRunning;
if(timeout == 0) /* If time-out is not configured */ if(timeout == 0) /* If time-out is not configured */
{ {
EventTaskToWait(pecb,curTCB); /* Block task until event occurs */ EventTaskToWait(pecb,curTCB); /* Block task until event occurs */
pecb->eventCounter--;
curTCB->pmail = Co_NULL; curTCB->pmail = Co_NULL;
OsSchedUnlock();
return E_OK; return E_OK;
} }
else /* If time-out is configured */ else /* If time-out is configured */
{ {
OsSchedLock();
/* Block task until event or timeout occurs */ /* Block task until event or timeout occurs */
EventTaskToWait(pecb,curTCB); EventTaskToWait(pecb,curTCB);
InsertDelayList(curTCB,timeout); InsertDelayList(curTCB,timeout);
@@ -226,7 +248,10 @@ StatusType CoPendSem(OS_EventID id,U32 timeout)
} }
else /* Event occurred or event have been deleted*/ else /* Event occurred or event have been deleted*/
{ {
OsSchedLock();
curTCB->pmail = Co_NULL; curTCB->pmail = Co_NULL;
pecb->eventCounter--;
OsSchedUnlock();
return E_OK; return E_OK;
} }
} }
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file serviceReq.c * @file serviceReq.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief servive request management implementation code of CooCox CoOS kernel. * @brief servive request management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file task.c * @file task.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief task management implementation code of CooCox CoOS kernel. * @brief task management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file time.c * @file time.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief time management implementation code of CooCox CoOS kernel. * @brief time management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file timer.c * @file timer.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief timer management implementation code of CooCox CoOS kernel. * @brief timer management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file utility.c * @file utility.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Utility management implementation code of CooCox CoOS kernel. * @brief Utility management implementation code of CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+27 -4
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file utility.h * @file utility.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Utility function header file * @brief Utility function header file
* @details This file including some defines and declares related to utility * @details This file including some defines and declares related to utility
* function. * function.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
+44 -7
View File
@@ -1,15 +1,38 @@
/** /**
******************************************************************************* *******************************************************************************
* @file prot.c * @file prot.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Compiler adapter for CooCox CoOS kernel. * @brief Compiler adapter for CooCox CoOS kernel.
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2010 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -159,7 +182,11 @@ void SetEnvironment (OS_STK *pstk)
{ {
__asm volatile __asm volatile
( (
#if CFG_CHIP_TYPE == 3
" SUB R0,#100 \n"
#else
" SUB R0,#28 \n" " SUB R0,#28 \n"
#endif
" MSR PSP,R0 \n" " MSR PSP,R0 \n"
" BX LR \n" " BX LR \n"
); );
@@ -258,7 +285,7 @@ void PendSV_Handler(void)
} }
#endif #endif
#if CFG_CHIP_TYPE == 1 #if CFG_CHIP_TYPE == 1 || 3 == CFG_CHIP_TYPE
void PendSV_Handler(void) void PendSV_Handler(void)
{ {
////////debug block ///////////////////////// ////////debug block /////////////////////////
@@ -275,21 +302,31 @@ void PendSV_Handler(void)
" MRS R0, PSP \n" // Get PSP point (can not use PUSH,in ISR,SP is MSP ) " MRS R0, PSP \n" // Get PSP point (can not use PUSH,in ISR,SP is MSP )
" STMDB R0!,{R4-R11} \n" // Store r4-r11,r0 -= regCnt * 4,r0 is new stack " STMDB R0!,{R4-R11} \n" // Store r4-r11,r0 -= regCnt * 4,r0 is new stack
// top point (addr h->l r11,r10,...,r5,r4) // top point (addr h->l r11,r10,...,r5,r4)
#if CFG_CHIP_TYPE == 3
" VSTMDB R0!, {S16-S31} \n" // store remaining FPU registers
#endif // CFG_FPU_ENABLE
" STR R0,[R1] \n" // Save orig PSP " STR R0,[R1] \n" // Save orig PSP
" STR R2, [R3] \n" // TCBRunning = TCBNext; " STR R2, [R3] \n" // TCBRunning = TCBNext;
" LDR R0, [R2] \n" // Get SP of task that be switch into. " LDR R0, [R2] \n" // Get SP of task that be switch into.
#if CFG_CHIP_TYPE == 3
" VLDMIA R0!, {S16-S31} \n" // load remaining FPU registers
#endif // CFG_FPU_ENABLE
" LDMIA R0!,{R4-R11} \n" // POP {R4-R11},R0 += regCnt * 4 " LDMIA R0!,{R4-R11} \n" // POP {R4-R11},R0 += regCnt * 4
" MSR PSP, R0 \n" // Mov new stack point to PSP " MSR PSP, R0 \n" // Mov new stack point to PSP
" exitPendSV: \n" " exitPendSV: \n"
" LDR R3,=OSSchedLock\n" " LDR R3,=OSSchedLock\n"
" MOVS R0, #0x0 \n" " MOVS R0, #0x0 \n"
" STRB R0, [R3] \n" " STRB R0, [R3] \n"
" ORR LR,LR,#0x04 \n" // Ensure exception return uses process stack " ORR LR,LR,#0x04 \n" // Ensure exception return uses process stack
#if CFG_CHIP_TYPE == 3
" LDR LR,=0xFFFFFFED \n"
#endif
" BX LR \n" // Exit interrupt " BX LR \n" // Exit interrupt
); );
} }
#endif #endif
+30 -5
View File
@@ -1,17 +1,40 @@
/** /**
******************************************************************************* *******************************************************************************
* @file OsArch.h * @file OsArch.h
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief Implement function declare related to Cortex-M3(ARM-v7) * @brief Implement function declare related to Cortex-M3(ARM-v7)
* @details This header file including functions or defines related to * @details This header file including functions or defines related to
* Cortex-M3(ARM-v7). * Cortex-M3(ARM-v7).
******************************************************************************* *******************************************************************************
* @copy * @copy
* *
* INTERNAL FILE,DON'T PUBLIC. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -47,4 +70,6 @@ extern U8 Inc8 (volatile U8 *data);
extern U8 Dec8 (volatile U8 *data); extern U8 Dec8 (volatile U8 *data);
extern void IRQ_ENABLE_RESTORE(void); extern void IRQ_ENABLE_RESTORE(void);
extern void IRQ_DISABLE_SAVE(void); extern void IRQ_DISABLE_SAVE(void);
#endif
#endif /* _CPU_H */
+34 -4
View File
@@ -1,14 +1,37 @@
/** /**
******************************************************************************* *******************************************************************************
* @file arch.c * @file arch.c
* @version V1.1.4 * @version V1.1.6
* @date 2011.04.20 * @date 2014.05.23
* @brief This file provides InitTaskContext() and SysTick_Handler(). * @brief This file provides InitTaskContext() and SysTick_Handler().
******************************************************************************* *******************************************************************************
* @copy * @copy
* WRITE COPY INFORMATION USE CAPITAL LETTER * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* *
* <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2> * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <ORGANIZATION> nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* <h2><center>&copy; COPYRIGHT 2014 CooCox </center></h2>
******************************************************************************* *******************************************************************************
*/ */
@@ -34,12 +57,19 @@ OS_STK *InitTaskContext(FUNCPtr task,void *param,OS_STK *pstk)
{ {
OS_STK *context; OS_STK *context;
context = pstk; context = pstk;
#if CFG_CHIP_TYPE == 3
context = context - 18;
#endif
*(context--) = (U32)0x01000000L; /* xPSR */ *(context--) = (U32)0x01000000L; /* xPSR */
*(context--) = (U32)task; /* Entry point of task. */ *(context--) = (U32)task; /* Entry point of task. */
*(context) = (U32)0xFFFFFFFEL; *(context) = (U32)0xFFFFFFFEL;
context = context - 5; context = context - 5;
*(context) = (U32)param; /* R0: argument */ *(context) = (U32)param; /* R0: argument */
context = context - 8; context = context - 8;
#if CFG_CHIP_TYPE == 3
context = context - 16;
#endif
// *(--context) = 0xfffffffd; /* LR */
return (context); /* Returns location of new stack top. */ return (context); /* Returns location of new stack top. */
} }
+2 -2
View File
@@ -726,7 +726,7 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
ifeq ($(SPORT_FILE_LOG), YES) ifeq ($(SPORT_FILE_LOG), YES)
CPPDEFS += -DSPORT_FILE_LOG CPPDEFS += -DSPORT_FILE_LOG
endif endif
INCDIRS += targets/sky9x CoOS/kernel CoOS/portable INCDIRS += targets/sky9x CoOS CoOS/kernel CoOS/portable
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
BOARDSRC = main_arm.cpp targets/sky9x/board_sky9x.cpp BOARDSRC = main_arm.cpp targets/sky9x/board_sky9x.cpp
EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp
@@ -840,7 +840,7 @@ ifeq ($(PCB), TARANIS)
PPM_CENTER_ADJUSTABLE = YES PPM_CENTER_ADJUSTABLE = YES
DSM2 = PPM DSM2 = PPM
CPPDEFS += -DPCBTARANIS -DCPUARM -DCPUSTM32 -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM_VARIANT=0 -DAUDIO -DPXX CPPDEFS += -DPCBTARANIS -DCPUARM -DCPUSTM32 -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM_VARIANT=0 -DAUDIO -DPXX
INCDIRS += targets/taranis CoOS/kernel CoOS/portable INCDIRS += targets/taranis CoOS CoOS/kernel CoOS/portable
ifeq ($(PCBREV), REV9E) ifeq ($(PCBREV), REV9E)
CPPDEFS += -DSTM32F40_41xxx CPPDEFS += -DSTM32F40_41xxx
EXTRAINCDIRS += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Include targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc EXTRAINCDIRS += targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Include targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc