aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorTheodore Ateba <tf.ateba@gmail.com>2017-09-02 14:15:59 +0000
committerTheodore Ateba <tf.ateba@gmail.com>2017-09-02 14:15:59 +0000
commit709a86373b0b629c26dfa217f98fcd3d3545eac6 (patch)
treea2455c3ac6bc7bef869b4e964de230c405a78dd0 /os
parent284e1810da0eed3cc7159db4e6df3fc85843acf9 (diff)
downloadChibiOS-709a86373b0b629c26dfa217f98fcd3d3545eac6.tar.gz
ChibiOS-709a86373b0b629c26dfa217f98fcd3d3545eac6.tar.bz2
ChibiOS-709a86373b0b629c26dfa217f98fcd3d3545eac6.zip
Correct code style and comment on GPT driver files.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10536 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.c10
-rw-r--r--os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.h4
2 files changed, 10 insertions, 4 deletions
diff --git a/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.c b/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.c
index 6ccc7cadd..98a33dd80 100644
--- a/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.c
+++ b/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.c
@@ -20,8 +20,8 @@
*/
/**
- * @file hal_gpt_lld.c
- * @brief AVR GPT driver subsystem low level driver.
+ * @file TIMv1/hal_gpt_lld.c
+ * @brief AVR/MEGA GPT subsystem low level driver source.
*
* @addtogroup GPT
* @{
@@ -102,6 +102,7 @@ static uint8_t clock_source_base[]= { 5, 4, 3, 2, 1 };
/*===========================================================================*/
static uint8_t prescaler(uint16_t freq, uint16_t *ratio, uint8_t n) {
+
uint8_t i;
for (i = 0; i < n; ++i) {
@@ -115,6 +116,7 @@ static uint8_t prescaler(uint16_t freq, uint16_t *ratio, uint8_t n) {
}
static void gpt_lld_serve_interrupt(GPTDriver *gptp) {
+
gptp->counter++;
if (gptp->counter == gptp->period) {
gptp->counter = 0;
@@ -130,7 +132,9 @@ static void gpt_lld_dummy_callback(GPTDriver *gptp) {
}
static uint8_t getTimerIndex(GPTDriver *gptp) {
+
uint8_t index = 0;
+
#if AVR_GPT_USE_TIM1 || defined(__DOXYGEN__)
if (gptp == &GPTD1) return index;
else index++;
@@ -264,6 +268,7 @@ void gpt_lld_init(void) {
* @notapi
*/
void gpt_lld_start(GPTDriver *gptp) {
+
uint8_t psc;
if (gptp->state == GPT_STOP) {
@@ -343,6 +348,7 @@ void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t period) {
* @notapi
*/
void gpt_lld_stop_timer(GPTDriver *gptp) {
+
uint8_t i = getTimerIndex(gptp);
*regs_table[i].tccrb &= ~((7 << CS10) | (1 << OCIE1A));
diff --git a/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.h b/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.h
index 0cd26e662..45ab14058 100644
--- a/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.h
+++ b/os/hal/ports/AVR/MEGA/LLD/TIMv1/hal_gpt_lld.h
@@ -20,8 +20,8 @@
*/
/**
- * @file hal_gpt_lld.h
- * @brief AVR GPT driver subsystem low level driver header.
+ * @file TIMv1/hal_gpt_lld.h
+ * @brief AVR/MEGA GPT subsystem low level driver header.
*
* @addtogroup GPT
* @{