summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/statusbar.c7
-rw-r--r--apps/settings.h2
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/drivers/rtc.c30
-rw-r--r--firmware/export/config-h300.h3
5 files changed, 41 insertions, 3 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 56d1647d9b..80de707a72 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -93,10 +93,15 @@
7*ICONS_SPACING
#define STATUSBAR_LOCKR_WIDTH 5
+#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
#define STATUSBAR_DISK_WIDTH 12
#define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \
STATUSBAR_DISK_WIDTH
-#define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width-1
+#else
+#define STATUSBAR_DISK_WIDTH 0
+#endif
+#define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width - 1 - \
+ STATUSBAR_DISK_WIDTH
struct gui_syncstatusbar statusbars;
diff --git a/apps/settings.h b/apps/settings.h
index 4bc0904fe4..263147c92c 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -53,7 +53,7 @@
#define SETTINGS_CANCEL2 BUTTON_MODE
#define SETTINGS_PREV BUTTON_LEFT
#define SETTINGS_NEXT BUTTON_RIGHT
-#define SETTINGS_ACCEPT BUTTON_MODE
+#define SETTINGS_ACCEPT BUTTON_ON
#elif CONFIG_KEYPAD == RECORDER_PAD
#define SETTINGS_INC BUTTON_UP
diff --git a/firmware/SOURCES b/firmware/SOURCES
index ce5ec7f803..7f07598273 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -105,7 +105,7 @@ drivers/pcf50606.c
#if defined(APPLE_IPODCOLOR) || defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO)
drivers/pcf50605.c
#endif
-#if CONFIG_RTC == RTC_M41ST84W
+#if (CONFIG_RTC == RTC_M41ST84W) || (CONFIG_RTC == RTC_PCF50606)
drivers/rtc.c
#endif
drivers/serial.c
diff --git a/firmware/drivers/rtc.c b/firmware/drivers/rtc.c
index b77db8b865..0e6d68eb1a 100644
--- a/firmware/drivers/rtc.c
+++ b/firmware/drivers/rtc.c
@@ -21,12 +21,41 @@
#include "i2c.h"
#include "rtc.h"
#include "kernel.h"
+#include "system.h"
+#include "pcf50606.h"
#include <stdbool.h>
#define RTC_ADR 0xd0
#define RTC_DEV_WRITE (RTC_ADR | 0x00)
#define RTC_DEV_READ (RTC_ADR | 0x01)
+#if CONFIG_RTC == RTC_PCF50606
+void rtc_init(void)
+{
+}
+int rtc_read_datetime(unsigned char* buf) {
+ int rc;
+ int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
+
+ rc = pcf50606_read_multiple(0x0a, buf, 7);
+
+ set_irq_level(oldlevel);
+
+ return rc;
+}
+
+int rtc_write_datetime(unsigned char* buf) {
+ int rc;
+ int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
+
+ rc = pcf50606_write_multiple(0x0a, buf, 7);
+
+ set_irq_level(oldlevel);
+
+ return rc;
+}
+
+#else
void rtc_init(void)
{
unsigned char data;
@@ -278,5 +307,6 @@ int rtc_write_datetime(unsigned char* buf) {
return rc;
}
+#endif /* CONFIG_RTC == RTC_PCF50606 */
#endif /* CONFIG_RTC */
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 54a2ef543f..2698d12098 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -30,6 +30,9 @@
/* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC
+/* define this if you have a real-time clock */
+#define CONFIG_RTC RTC_PCF50606
+
/* Define this if you have an remote lcd */
#define HAVE_REMOTE_LCD