kopia lustrzana https://github.com/OpenRTX/OpenRTX
Created "peripherals" include folder for non-mandatory drivers, moved rtc.h to peripherals folder.
rodzic
009930f914
commit
dcafd07085
|
@ -277,7 +277,6 @@ linux_platform_src = ['platform/targets/linux/emulator/emulator.c',
|
|||
'platform/drivers/GPS/GPS_linux.c',
|
||||
'platform/mcu/x86_64/drivers/gpio.c',
|
||||
'platform/mcu/x86_64/drivers/delays.c',
|
||||
'platform/mcu/x86_64/drivers/rtc.c',
|
||||
'platform/drivers/baseband/radio_linux.cpp',
|
||||
'platform/drivers/audio/audio_linux.c',
|
||||
'platform/drivers/audio/inputStream_linux.cpp',
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#ifndef STATE_H
|
||||
#define STATE_H
|
||||
|
||||
#include <interfaces/rtc.h>
|
||||
#include <datatypes.h>
|
||||
#include <settings.h>
|
||||
#include <pthread.h>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
||||
***************************************************************************/
|
||||
|
||||
#include <interfaces/rtc.h>
|
||||
#include <peripherals/rtc.h>
|
||||
#include <stm32f4xx.h>
|
||||
|
||||
void rtc_init()
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2020 - 2023 by Federico Amedeo Izzo IU2NUO, *
|
||||
* Niccolò Izzo IU2KIN, *
|
||||
* Silvano Seva IU2KWO *
|
||||
* *
|
||||
* This program 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. *
|
||||
* *
|
||||
* This program 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/> *
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <interfaces/rtc.h>
|
||||
|
||||
void rtc_init()
|
||||
{
|
||||
printf("rtc_init()\n");
|
||||
}
|
||||
|
||||
void rtc_terminate()
|
||||
{
|
||||
printf("rtc_shutdown()\n");
|
||||
}
|
||||
|
||||
void rtc_setTime(datetime_t t)
|
||||
{
|
||||
(void) t;
|
||||
|
||||
printf("rtc_setTime(t)\n");
|
||||
}
|
||||
|
||||
void rtc_setHour(uint8_t hours, uint8_t minutes, uint8_t seconds)
|
||||
{
|
||||
printf("rtc_setHour(%d, %d, %d)\n", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
void rtc_setDate(uint8_t date, uint8_t month, uint8_t year)
|
||||
{
|
||||
printf("rtc_setDate(%d, %d, %d)\n", date, month, year);
|
||||
}
|
||||
|
||||
datetime_t rtc_getTime()
|
||||
{
|
||||
datetime_t t;
|
||||
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
time ( &rawtime );
|
||||
timeinfo = gmtime ( &rawtime );
|
||||
//radio expects time to be TZ-less, so use gmtime instead of localtime.
|
||||
|
||||
t.hour = timeinfo->tm_hour;
|
||||
t.minute = timeinfo->tm_min;
|
||||
t.second = timeinfo->tm_sec;
|
||||
t.day = timeinfo->tm_wday;
|
||||
t.date = timeinfo->tm_mday;
|
||||
t.month = timeinfo->tm_mon + 1;
|
||||
// Only last two digits of the year are supported in OpenRTX
|
||||
t.year = (timeinfo->tm_year + 1900) % 100;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
void rtc_dstSet()
|
||||
{
|
||||
printf("rtc_dstSet()\n");
|
||||
}
|
||||
|
||||
void rtc_dstClear()
|
||||
{
|
||||
printf("rtc_dstClear()\n");
|
||||
}
|
|
@ -25,7 +25,7 @@
|
|||
#include <ADC1_MDx.h>
|
||||
#include <calibInfo_MDx.h>
|
||||
#include <toneGenerator_MDx.h>
|
||||
#include <interfaces/rtc.h>
|
||||
#include <peripherals/rtc.h>
|
||||
#include <interfaces/audio.h>
|
||||
|
||||
static hwInfo_t hwInfo;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <ADC1_MDx.h>
|
||||
#include <calibInfo_MDx.h>
|
||||
#include <toneGenerator_MDx.h>
|
||||
#include <interfaces/rtc.h>
|
||||
#include <peripherals/rtc.h>
|
||||
#include <interfaces/audio.h>
|
||||
#include <SPI2.h>
|
||||
#include <chSelector.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <calibInfo_MDx.h>
|
||||
#include <interfaces/nvmem.h>
|
||||
#include <toneGenerator_MDx.h>
|
||||
#include <interfaces/rtc.h>
|
||||
#include <peripherals/rtc.h>
|
||||
#include <interfaces/audio.h>
|
||||
#include <chSelector.h>
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue