Skip to content
Snippets Groups Projects
Unverified Commit 67048eaf authored by Dylan Laduranty's avatar Dylan Laduranty Committed by GitHub
Browse files

Merge pull request #6900 from OTAkeys/pr/init_rtc

periph/rtc: move init from auto_init to periph_init
parents f89ecfb5 012264cb
Branches
No related tags found
No related merge requests found
......@@ -23,6 +23,9 @@
#ifdef MODULE_PERIPH_SPI
#include "periph/spi.h"
#endif
#ifdef MODULE_PERIPH_RTC
#include "periph/rtc.h"
#endif
void periph_init(void)
{
......@@ -32,4 +35,9 @@ void periph_init(void)
spi_init(SPI_DEV(i));
}
#endif
/* Initialize RTC */
#ifdef MODULE_PERIPH_RTC
rtc_init();
#endif
}
......@@ -29,10 +29,6 @@
#include "shell.h"
#include "shell_commands.h"
#if FEATURE_PERIPH_RTC
#include "periph/rtc.h"
#endif
#ifdef MODULE_NETIF
#include "net/gnrc/pktdump.h"
#include "net/gnrc.h"
......@@ -40,10 +36,6 @@
int main(void)
{
#ifdef FEATURE_PERIPH_RTC
rtc_init();
#endif
#ifdef MODULE_NETIF
gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
gnrc_pktdump_pid);
......
......@@ -32,10 +32,6 @@
#include "xtimer.h"
#endif
#ifdef MODULE_RTC
#include "periph/rtc.h"
#endif
#ifdef MODULE_GNRC_SIXLOWPAN
#include "net/gnrc/sixlowpan.h"
#endif
......@@ -102,10 +98,6 @@ void auto_init(void)
DEBUG("Auto init xtimer module.\n");
xtimer_init();
#endif
#ifdef MODULE_RTC
DEBUG("Auto init rtc module.\n");
rtc_init();
#endif
#ifdef MODULE_SHT11
DEBUG("Auto init SHT11 module.\n");
sht11_init();
......
......@@ -139,7 +139,6 @@ static int _rtc_usage(void)
{
puts("usage: rtc <command> [arguments]");
puts("commands:");
puts("\tinit\t\tinitialize the interface");
puts("\tpoweron\t\tpower the interface on");
puts("\tpoweroff\tpower the interface off");
puts("\tclearalarm\tdeactivate the current alarm");
......@@ -156,9 +155,6 @@ int _rtc_handler(int argc, char **argv)
_rtc_usage();
return 1;
}
else if (strncmp(argv[1], "init", 4) == 0) {
rtc_init();
}
else if (strncmp(argv[1], "poweron", 7) == 0) {
rtc_poweron();
}
......
......@@ -57,7 +57,7 @@ extern int _at30tse75x_handler(int argc, char **argv);
extern int _saul(int argc, char **argv);
#endif
#if FEATURE_PERIPH_RTC
#ifdef MODULE_PERIPH_RTC
extern int _rtc_handler(int argc, char **argv);
#endif
......@@ -187,7 +187,7 @@ const shell_command_t _shell_command_list[] = {
{ "random_init", "initializes the PRNG", _random_init },
{ "random_get", "returns 32 bit of pseudo randomness", _random_get },
#endif
#if FEATURE_PERIPH_RTC
#ifdef MODULE_PERIPH_RTC
{"rtc", "control RTC peripheral interface", _rtc_handler},
#endif
#ifdef CPU_X86
......
......@@ -83,9 +83,6 @@ int main(void)
printf("This test will display 'Alarm!' every %u seconds for %u times\n",
PERIOD, REPEAT);
/* initialize RTC */
rtc_init();
/* set RTC */
print_time(" Setting clock to ", &time);
rtc_set_time(&time);
......
......@@ -354,7 +354,6 @@ int main(void)
/* the rtc is used in diskio.c for timestamps of files */
puts("Initializing the RTC driver");
rtc_poweron();
rtc_init();
struct tm time;
time.tm_year = TEST_FATFS_RTC_YEAR - RTC_YEAR_OFFSET; /* years are counted from 1900 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment