Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to ChibiOS 17.6.3 #2025

Open
wants to merge 43 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7f71a65
RTOS: Remove ChibiOS 2.6.6
glowtape Jan 5, 2018
463e649
RTOS: Add ChibiOS 17.6.3
glowtape Jan 5, 2018
e16f726
ChibiOS F0,F1,F3,F4: Don't use CMSIS supplied with ChibiOS.
glowtape Jan 5, 2018
ce03587
ChibiOS,stm32_registry: Prevent redefinition of STM32F40_41xxx
glowtape Jan 5, 2018
3c568ca
ChibiOS: Clear CCM RAM, too, when BSS init is desired.
glowtape Jan 5, 2018
713caec
ChibiOS,HAL,F446: New ChibiOS suddenly has issues with HSECLK being a…
glowtape Jan 6, 2018
cea64dd
pios_mutex: Rename types and calls, update unlocking next mutex metho…
glowtape Jan 5, 2018
6f7456d
pios_queue: Rename types and calls for new ChibiOS.
glowtape Jan 5, 2018
8e38a0c
pios_semaphore: Rename types and calls for new ChibiOS.
glowtape Jan 5, 2018
99abbf1
pios_thread: Rename types and calls for new ChibiOS.
glowtape Jan 5, 2018
4261424
pios_usb: New ChibiOS HAL remaps the USB IRQ depending on the F3 type.
glowtape Jan 6, 2018
8b13690
pios: Updated ChibiOS configuration headers (chconf.h, halconf.h)
glowtape Jan 5, 2018
10c7be0
loadable: MemManageVector got renamed to MemManage_Handler in new Chi…
glowtape Jan 5, 2018
8bed3a6
all targets: Makefile changes, introduce $STM32_SUBTYPE, make non-F4 …
glowtape Jan 5, 2018
53ff02e
all targets: Don't reset ADEFS that might have been defined in an inc…
glowtape Jan 5, 2018
21d07d7
F4: Update ChibiOS library.mk makefile
glowtape Jan 5, 2018
a5ed161
F4: Added sections for ChibiOS 17 to linker scripts. Renamed ResetHan…
glowtape Jan 5, 2018
d757e00
F4: Fix linker script lookup. Specify some startup defines.
glowtape Jan 5, 2018
2383793
F4: Add the STM32_SUBTYPE stuff and fixed linker script lookup to boo…
glowtape Jan 5, 2018
332b34d
F3: Update ChibiOS library.mk makefile
glowtape Jan 5, 2018
7f5aec7
F3: Added sections for ChibiOS 17 to linker scripts. Renamed ResetHan…
glowtape Jan 5, 2018
8a7fe22
F3: Specify some startup defines.
glowtape Jan 5, 2018
f043f65
F3: Redirect ChibiOS to project own CMSIS
glowtape Jan 6, 2018
a55c893
sprf3e: Adapt to new USB IRQ handling, disable diagnostics for memory…
glowtape Jan 6, 2018
6dd7b2d
lux: Adapt to new USB IRQ handling.
glowtape Jan 6, 2018
d112bd8
omnibusf3: Adapt to new USB IRQ handling.
glowtape Jan 6, 2018
52a082c
pikoblx: Adapt to new USB IRQ handling.
glowtape Jan 6, 2018
2966618
dtfc: Adapt to new USB IRQ handling.
glowtape Jan 6, 2018
c4cfaf0
sparky: Adapt to new USB IRQ handling, axed two modules to save flash…
glowtape Jan 6, 2018
402f588
F1: Update ChibiOS references in makefile
glowtape Jan 6, 2018
40e1eed
F1: Added sections for ChibiOS 17 to linker scripts. Renamed ResetHan…
glowtape Jan 6, 2018
ec60584
F1,ChibiOS,stm32_registry: Stop it from whining about platform flags.
glowtape Jan 6, 2018
5a8600c
F1: Redirect ChibiOS to project own CMSIS
glowtape Jan 6, 2018
00a02b8
pipxtreme: Updated chconf.h and mcuconf.h, resolve variable conflict …
glowtape Jan 6, 2018
3467596
pios_thread: Forgot to rename a #define.
glowtape Apr 15, 2018
98de70b
chconf: Probably ought to put defines in right order. (fixup)
glowtape Apr 15, 2018
3eb5fa9
pios_thread: Fix SNAFU, ticks_total was our own field. (fixup)
glowtape Apr 15, 2018
b4e69d0
pios_heap: Use memcore with ChibiOS for standard heap.
glowtape Apr 15, 2018
30d977f
pios_thread: Use ChibiOS' allocator for aligned alloc. Store stack lo…
glowtape Apr 15, 2018
31298ca
F4: Change heap stuff for memcore (fixup).
glowtape Apr 15, 2018
1d90679
F3: Change heap stuff for memcore (fixup).
glowtape Apr 16, 2018
330d942
F1: Change heap stuff for memcore (fixup).
glowtape Apr 16, 2018
69fad6a
chibios: Default MSP init to on.
glowtape Apr 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions flight/Modules/Loadable/loadable.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ void MemManageHandler_C(uint32_t *exception_stack) {
exception_stack[EXCEPTION_STACK_PC_OFFSET] = pc;
}

void MemManageVector(void) __attribute__((naked));
void MemManage_Handler(void) __attribute__((naked));

void MemManageVector(void)
void MemManage_Handler(void)
{
/* Stores the exception stack pointer into an argument, and invokes
* the real handler (without linkage-- the BX LR at completion of
Expand Down
2 changes: 1 addition & 1 deletion flight/PiOS/Common/Libraries/ChibiOS/documentation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=http://www.chibios.org/dokuwiki/doku.php?id=chibios:documents">
<meta http-equiv="Refresh" content="0; URL=http://www.chibios.org/dokuwiki/doku.php?id=chibios:documentation:start">
</head>
<body>
</body>
Expand Down
48 changes: 0 additions & 48 deletions flight/PiOS/Common/Libraries/ChibiOS/exception.txt

This file was deleted.

311 changes: 311 additions & 0 deletions flight/PiOS/Common/Libraries/ChibiOS/os/common/oslib/include/chbsem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio.

This file is part of ChibiOS.

ChibiOS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

ChibiOS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* @file chbsem.h
* @brief Binary semaphores structures and macros.
*
* @addtogroup binary_semaphores
* @details Binary semaphores related APIs and services.
* <h2>Operation mode</h2>
* Binary semaphores are implemented as a set of inline functions
* that use the existing counting semaphores primitives. The
* difference between counting and binary semaphores is that the
* counter of binary semaphores is not allowed to grow above the
* value 1. Repeated signal operation are ignored. A binary
* semaphore can thus have only two defined states:
* - <b>Taken</b>, when its counter has a value of zero or lower
* than zero. A negative number represent the number of threads
* queued on the binary semaphore.
* - <b>Not taken</b>, when its counter has a value of one.
* .
* Binary semaphores are different from mutexes because there is no
* concept of ownership, a binary semaphore can be taken by a
* thread and signaled by another thread or an interrupt handler,
* mutexes can only be taken and released by the same thread. Another
* difference is that binary semaphores, unlike mutexes, do not
* implement the priority inheritance protocol.<br>
* In order to use the binary semaphores APIs the
* @p CH_CFG_USE_SEMAPHORES option must be enabled in @p chconf.h.
* @{
*/

#ifndef CHBSEM_H
#define CHBSEM_H

#if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)

/*===========================================================================*/
/* Module constants. */
/*===========================================================================*/

/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/

/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/

/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/

/**
* @extends semaphore_t
*
* @brief Binary semaphore type.
*/
typedef struct {
semaphore_t sem;
} binary_semaphore_t;

/*===========================================================================*/
/* Module macros. */
/*===========================================================================*/

/**
* @brief Data part of a static semaphore initializer.
* @details This macro should be used when statically initializing a semaphore
* that is part of a bigger structure.
*
* @param[in] name the name of the semaphore variable
* @param[in] taken the semaphore initial state
*/
#define _BSEMAPHORE_DATA(name, taken) \
{_SEMAPHORE_DATA(name.sem, ((taken) ? 0 : 1))}

/**
* @brief Static semaphore initializer.
* @details Statically initialized semaphores require no explicit
* initialization using @p chBSemInit().
*
* @param[in] name the name of the semaphore variable
* @param[in] taken the semaphore initial state
*/
#define BSEMAPHORE_DECL(name, taken) \
binary_semaphore_t name = _BSEMAPHORE_DATA(name, taken)

/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

/*===========================================================================*/
/* Module inline functions. */
/*===========================================================================*/

/**
* @brief Initializes a binary semaphore.
*
* @param[out] bsp pointer to a @p binary_semaphore_t structure
* @param[in] taken initial state of the binary semaphore:
* - @a false, the initial state is not taken.
* - @a true, the initial state is taken.
* .
*
* @init
*/
static inline void chBSemObjectInit(binary_semaphore_t *bsp, bool taken) {

chSemObjectInit(&bsp->sem, taken ? (cnt_t)0 : (cnt_t)1);
}

/**
* @brief Wait operation on the binary semaphore.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @return A message specifying how the invoking thread has been
* released from the semaphore.
* @retval MSG_OK if the binary semaphore has been successfully taken.
* @retval MSG_RESET if the binary semaphore has been reset using
* @p bsemReset().
*
* @api
*/
static inline msg_t chBSemWait(binary_semaphore_t *bsp) {

return chSemWait(&bsp->sem);
}

/**
* @brief Wait operation on the binary semaphore.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @return A message specifying how the invoking thread has been
* released from the semaphore.
* @retval MSG_OK if the binary semaphore has been successfully taken.
* @retval MSG_RESET if the binary semaphore has been reset using
* @p bsemReset().
*
* @sclass
*/
static inline msg_t chBSemWaitS(binary_semaphore_t *bsp) {

chDbgCheckClassS();

return chSemWaitS(&bsp->sem);
}

/**
* @brief Wait operation on the binary semaphore.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
* .
* @return A message specifying how the invoking thread has been
* released from the semaphore.
* @retval MSG_OK if the binary semaphore has been successfully taken.
* @retval MSG_RESET if the binary semaphore has been reset using
* @p bsemReset().
* @retval MSG_TIMEOUT if the binary semaphore has not been signaled or reset
* within the specified timeout.
*
* @sclass
*/
static inline msg_t chBSemWaitTimeoutS(binary_semaphore_t *bsp,
systime_t time) {

chDbgCheckClassS();

return chSemWaitTimeoutS(&bsp->sem, time);
}

/**
* @brief Wait operation on the binary semaphore.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
* .
* @return A message specifying how the invoking thread has been
* released from the semaphore.
* @retval MSG_OK if the binary semaphore has been successfully taken.
* @retval MSG_RESET if the binary semaphore has been reset using
* @p bsemReset().
* @retval MSG_TIMEOUT if the binary semaphore has not been signaled or reset
* within the specified timeout.
*
* @api
*/
static inline msg_t chBSemWaitTimeout(binary_semaphore_t *bsp,
systime_t time) {

return chSemWaitTimeout(&bsp->sem, time);
}

/**
* @brief Reset operation on the binary semaphore.
* @note The released threads can recognize they were waked up by a reset
* rather than a signal because the @p bsemWait() will return
* @p MSG_RESET instead of @p MSG_OK.
* @note This function does not reschedule.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @param[in] taken new state of the binary semaphore
* - @a false, the new state is not taken.
* - @a true, the new state is taken.
* .
*
* @iclass
*/
static inline void chBSemResetI(binary_semaphore_t *bsp, bool taken) {

chDbgCheckClassI();

chSemResetI(&bsp->sem, taken ? (cnt_t)0 : (cnt_t)1);
}

/**
* @brief Reset operation on the binary semaphore.
* @note The released threads can recognize they were waked up by a reset
* rather than a signal because the @p bsemWait() will return
* @p MSG_RESET instead of @p MSG_OK.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @param[in] taken new state of the binary semaphore
* - @a false, the new state is not taken.
* - @a true, the new state is taken.
* .
*
* @api
*/
static inline void chBSemReset(binary_semaphore_t *bsp, bool taken) {

chSemReset(&bsp->sem, taken ? (cnt_t)0 : (cnt_t)1);
}

/**
* @brief Performs a signal operation on a binary semaphore.
* @note This function does not reschedule.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
*
* @iclass
*/
static inline void chBSemSignalI(binary_semaphore_t *bsp) {

chDbgCheckClassI();

if (bsp->sem.cnt < (cnt_t)1) {
chSemSignalI(&bsp->sem);
}
}

/**
* @brief Performs a signal operation on a binary semaphore.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
*
* @api
*/
static inline void chBSemSignal(binary_semaphore_t *bsp) {

chSysLock();
chBSemSignalI(bsp);
chSchRescheduleS();
chSysUnlock();
}

/**
* @brief Returns the binary semaphore current state.
*
* @param[in] bsp pointer to a @p binary_semaphore_t structure
* @return The binary semaphore current state.
* @retval false if the binary semaphore is not taken.
* @retval true if the binary semaphore is taken.
*
* @iclass
*/
static inline bool chBSemGetStateI(binary_semaphore_t *bsp) {

chDbgCheckClassI();

return (bsp->sem.cnt > (cnt_t)0) ? false : true;
}

#endif /* CH_CFG_USE_SEMAPHORES == TRUE */

#endif /* CHBSEM_H */

/** @} */
Loading