Skip to content

Commit

Permalink
Chibios: update examples to current chibios git.
Browse files Browse the repository at this point in the history
Match the changes in mainline chibios:
 - update chconf.h
 - update supplied ld scripts structure
 - update Teensy instructions (switch to official
    chibios and introduce contrib)
  • Loading branch information
flabbergast authored and tmk committed May 22, 2016
1 parent e661296 commit 82e8e6f
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 192 deletions.
63 changes: 44 additions & 19 deletions keyboard/infinity_chibios/chconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
* @{
*/

#ifndef _CHCONF_H_
#define _CHCONF_H_
#ifndef CHCONF_H
#define CHCONF_H

#define _CHIBIOS_RT_CONF_

/*===========================================================================*/
/**
Expand Down Expand Up @@ -103,6 +105,10 @@
*/
#define CH_CFG_NO_IDLE_THREAD FALSE

/* Use __WFI in the idle thread for waiting. Does lower the power
* consumption. */
#define CORTEX_ENABLE_WFI_IDLE TRUE

/** @} */

/*===========================================================================*/
Expand Down Expand Up @@ -262,14 +268,6 @@
*/
#define CH_CFG_USE_MAILBOXES TRUE

/**
* @brief I/O Queues APIs.
* @details If enabled then the I/O queues APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_QUEUES TRUE

/**
* @brief Core Memory Manager APIs.
* @details If enabled then the core memory manager APIs are included
Expand Down Expand Up @@ -357,12 +355,18 @@

/**
* @brief Debug option, trace buffer.
* @details If enabled then the context switch circular trace buffer is
* activated.
* @details If enabled then the trace buffer is activated.
*
* @note The default is @p FALSE.
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
*/
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED

/**
* @brief Trace buffer entries.
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
* different from @p CH_DBG_TRACE_MASK_DISABLED.
*/
#define CH_DBG_ENABLE_TRACE FALSE
#define CH_DBG_TRACE_BUFFER_SIZE 128

/**
* @brief Debug option, stack checks.
Expand Down Expand Up @@ -427,10 +431,6 @@
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
*
* @note It is inserted into lock zone.
* @note It is also invoked when the threads simply return in order to
* terminate.
*/
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
Expand All @@ -444,13 +444,28 @@
/* Context switch code here.*/ \
}

/**
* @brief ISR enter hook.
*/
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
/* IRQ prologue code here.*/ \
}

/**
* @brief ISR exit hook.
*/
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
/* IRQ epilogue code here.*/ \
}

/**
* @brief Idle thread enter hook.
* @note This hook is invoked within a critical zone, no OS functions
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
#define CH_CFG_IDLE_ENTER_HOOK() { \
/* Idle-enter code here.*/ \
}

/**
Expand All @@ -460,6 +475,7 @@
* @note This macro can be used to deactivate a power saving mode.
*/
#define CH_CFG_IDLE_LEAVE_HOOK() { \
/* Idle-leave code here.*/ \
}

/**
Expand Down Expand Up @@ -488,12 +504,21 @@
/* System halt code here.*/ \
}

/**
* @brief Trace hook.
* @details This hook is invoked each time a new record is written in the
* trace buffer.
*/
#define CH_CFG_TRACE_HOOK(tep) { \
/* Trace code here.*/ \
}

/** @} */

/*===========================================================================*/
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/

#endif /* _CHCONF_H_ */
#endif /* CHCONF_H */

/** @} */
59 changes: 40 additions & 19 deletions keyboard/stm32_f072_onekey/chconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
* @{
*/

#ifndef _CHCONF_H_
#define _CHCONF_H_
#ifndef CHCONF_H
#define CHCONF_H

#define _CHIBIOS_RT_CONF_

/*===========================================================================*/
/**
Expand Down Expand Up @@ -266,14 +268,6 @@
*/
#define CH_CFG_USE_MAILBOXES TRUE

/**
* @brief I/O Queues APIs.
* @details If enabled then the I/O queues APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_QUEUES TRUE

/**
* @brief Core Memory Manager APIs.
* @details If enabled then the core memory manager APIs are included
Expand Down Expand Up @@ -361,12 +355,18 @@

/**
* @brief Debug option, trace buffer.
* @details If enabled then the context switch circular trace buffer is
* activated.
* @details If enabled then the trace buffer is activated.
*
* @note The default is @p FALSE.
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
*/
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED

/**
* @brief Trace buffer entries.
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
* different from @p CH_DBG_TRACE_MASK_DISABLED.
*/
#define CH_DBG_ENABLE_TRACE FALSE
#define CH_DBG_TRACE_BUFFER_SIZE 128

/**
* @brief Debug option, stack checks.
Expand Down Expand Up @@ -431,10 +431,6 @@
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
*
* @note It is inserted into lock zone.
* @note It is also invoked when the threads simply return in order to
* terminate.
*/
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
Expand All @@ -448,13 +444,28 @@
/* Context switch code here.*/ \
}

/**
* @brief ISR enter hook.
*/
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
/* IRQ prologue code here.*/ \
}

/**
* @brief ISR exit hook.
*/
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
/* IRQ epilogue code here.*/ \
}

/**
* @brief Idle thread enter hook.
* @note This hook is invoked within a critical zone, no OS functions
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
#define CH_CFG_IDLE_ENTER_HOOK() { \
/* Idle-enter code here.*/ \
}

/**
Expand All @@ -464,6 +475,7 @@
* @note This macro can be used to deactivate a power saving mode.
*/
#define CH_CFG_IDLE_LEAVE_HOOK() { \
/* Idle-leave code here.*/ \
}

/**
Expand Down Expand Up @@ -492,12 +504,21 @@
/* System halt code here.*/ \
}

/**
* @brief Trace hook.
* @details This hook is invoked each time a new record is written in the
* trace buffer.
*/
#define CH_CFG_TRACE_HOOK(tep) { \
/* Trace code here.*/ \
}

/** @} */

/*===========================================================================*/
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/

#endif /* _CHCONF_H_ */
#endif /* CHCONF_H */

/** @} */
2 changes: 1 addition & 1 deletion keyboard/stm32_f103_onekey/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BOARD = GENERIC_STM32_F103

# MAPLE MINI
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
# MCU_LDSCRIPT = STM32F103xE_maplemini_bootloader
# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
# BOARD = MAPLEMINI_STM32_F103

## chip/board settings
Expand Down
59 changes: 40 additions & 19 deletions keyboard/stm32_f103_onekey/chconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
* @{
*/

#ifndef _CHCONF_H_
#define _CHCONF_H_
#ifndef CHCONF_H
#define CHCONF_H

#define _CHIBIOS_RT_CONF_

/*===========================================================================*/
/**
Expand Down Expand Up @@ -266,14 +268,6 @@
*/
#define CH_CFG_USE_MAILBOXES TRUE

/**
* @brief I/O Queues APIs.
* @details If enabled then the I/O queues APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_QUEUES TRUE

/**
* @brief Core Memory Manager APIs.
* @details If enabled then the core memory manager APIs are included
Expand Down Expand Up @@ -361,12 +355,18 @@

/**
* @brief Debug option, trace buffer.
* @details If enabled then the context switch circular trace buffer is
* activated.
* @details If enabled then the trace buffer is activated.
*
* @note The default is @p FALSE.
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
*/
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED

/**
* @brief Trace buffer entries.
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
* different from @p CH_DBG_TRACE_MASK_DISABLED.
*/
#define CH_DBG_ENABLE_TRACE FALSE
#define CH_DBG_TRACE_BUFFER_SIZE 128

/**
* @brief Debug option, stack checks.
Expand Down Expand Up @@ -431,10 +431,6 @@
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
*
* @note It is inserted into lock zone.
* @note It is also invoked when the threads simply return in order to
* terminate.
*/
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
Expand All @@ -448,13 +444,28 @@
/* Context switch code here.*/ \
}

/**
* @brief ISR enter hook.
*/
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
/* IRQ prologue code here.*/ \
}

/**
* @brief ISR exit hook.
*/
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
/* IRQ epilogue code here.*/ \
}

/**
* @brief Idle thread enter hook.
* @note This hook is invoked within a critical zone, no OS functions
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
#define CH_CFG_IDLE_ENTER_HOOK() { \
/* Idle-enter code here.*/ \
}

/**
Expand All @@ -464,6 +475,7 @@
* @note This macro can be used to deactivate a power saving mode.
*/
#define CH_CFG_IDLE_LEAVE_HOOK() { \
/* Idle-leave code here.*/ \
}

/**
Expand Down Expand Up @@ -492,12 +504,21 @@
/* System halt code here.*/ \
}

/**
* @brief Trace hook.
* @details This hook is invoked each time a new record is written in the
* trace buffer.
*/
#define CH_CFG_TRACE_HOOK(tep) { \
/* Trace code here.*/ \
}

/** @} */

/*===========================================================================*/
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/

#endif /* _CHCONF_H_ */
#endif /* CHCONF_H */

/** @} */
Loading

0 comments on commit 82e8e6f

Please sign in to comment.