boards/arm/samv7/same70-qmtech: add /dev/timer0 support

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2022-03-18 15:40:07 +01:00 committed by Xiang Xiao
parent 2793e6f82d
commit c1fb14ccaa
2 changed files with 13 additions and 6 deletions

View File

@ -21,12 +21,6 @@
#ifndef __ARCH_ARM_SRC_SAMV7_SAM_TC_LOWERHALF_H
#define __ARCH_ARM_SRC_SAMV7_SAM_TC_LOWERHALF_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View File

@ -63,6 +63,11 @@
# include "board_progmem.h"
#endif
#ifdef CONFIG_TIMER
# include "sam_tc.h"
# include "sam_tc_lowerhalf.h"
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -227,6 +232,14 @@ int sam_bringup(void)
}
#endif
#if defined(CONFIG_TIMER) && defined(CONFIG_SAMV7_TC0)
ret = sam_timer_initialize("/dev/timer0", TC_CHAN2);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: sam_timer_initialize failed: %d\n", ret);
}
#endif
/* If we got here then perhaps not all initialization was successful, but
* at least enough succeeded to bring-up NSH with perhaps reduced
* capabilities.