Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
7039ad0a
Commit
7039ad0a
authored
Oct 07, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EM2 enabled.
parent
c5c435e9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
5 deletions
+15
-5
backlight.c
sw/common/drivers/backlight.c
+6
-1
buzzer.c
sw/common/drivers/buzzer.c
+3
-0
lcd_dma.c
sw/common/drivers/lcd_dma.c
+3
-0
eeprom_emulation.c
sw/common/eeprom_emulation.c
+1
-1
FreeRTOSConfig.h
sw/freertos/src/FreeRTOSConfig.h
+1
-1
state.c
sw/freertos/src/state.c
+1
-2
No files found.
sw/common/drivers/backlight.c
View file @
7039ad0a
...
...
@@ -31,6 +31,8 @@
#include <em_gpio.h>
#include <em_timer.h>
#include "sleep.h"
static
int
backlight_level
;
void
backlight_init
(
void
)
...
...
@@ -101,10 +103,13 @@ void backlight_set_level(int level)
if
(
level
<=
0
)
{
TIMER_Enable
(
TIMER1
,
false
);
level
=
0
;
// in case level is negative
SLEEP_SleepBlockEnd
(
sleepEM2
);
}
else
{
// Reenable the timer, if it was turned off previously
if
(
backlight_level
==
0
)
if
(
backlight_level
==
0
)
{
SLEEP_SleepBlockBegin
(
sleepEM2
);
TIMER_Enable
(
TIMER1
,
true
);
}
if
(
level
>
BL_MAX_LEVEL
)
level
=
BL_MAX_LEVEL
;
...
...
sw/common/drivers/buzzer.c
View file @
7039ad0a
...
...
@@ -30,6 +30,7 @@
#include <em_cmu.h>
#include <em_gpio.h>
#include <em_timer.h>
#include <sleep.h>
void
buzzer_init
(
void
)
{
...
...
@@ -82,12 +83,14 @@ void buzzer_init(void)
void
buzzer_enable
(
void
)
{
SLEEP_SleepBlockBegin
(
sleepEM2
);
TIMER_Enable
(
TIMER2
,
true
);
}
void
buzzer_disable
(
void
)
{
TIMER_Enable
(
TIMER2
,
false
);
SLEEP_SleepBlockEnd
(
sleepEM2
);
}
void
buzzer_set_freq
(
int
frequency
)
...
...
sw/common/drivers/lcd_dma.c
View file @
7039ad0a
...
...
@@ -27,6 +27,7 @@
#include "em_ebi.h"
#include "em_cmu.h"
#include "em_usart.h"
#include "sleep.h"
#include "dmactrl.h"
#include "lcd.h"
#include "lcd_dma.h"
...
...
@@ -62,6 +63,7 @@ static void lcd_dma_tx_complete(unsigned int channel, bool primary, void *user)
dma_transfer_active
=
false
;
#ifdef FREERTOS
SLEEP_SleepBlockEnd
(
sleepEM2
);
xSemaphoreGive
(
lcd_sem
);
#endif
/* FREERTOS */
}
...
...
@@ -126,6 +128,7 @@ void lcd_dma_send_frame(void)
#endif
/* else FREERTOS */
dma_transfer_active
=
true
;
SLEEP_SleepBlockBegin
(
sleepEM2
);
DMA_ActivateScatterGather
(
DMA_CHANNEL
,
true
,
dma_cfg_block
,
DMA_TRANSFERS
);
// semaphore is given back in the DMA transfer finished interrupt
...
...
sw/common/eeprom_emulation.c
View file @
7039ad0a
...
...
@@ -464,7 +464,7 @@ bool EE_Init(uint32_t numberOfPages)
else
{
/* Transfer variables from active to receiving page. */
EE_TransferPage
(
NULL
,
NULL
);
EE_TransferPage
(
NULL
,
0
);
}
/* Initialization completed successfully */
...
...
sw/freertos/src/FreeRTOSConfig.h
View file @
7039ad0a
...
...
@@ -89,7 +89,7 @@ extern "C" {
/* Available options when configUSE_TICKLESS_IDLE set to 1
* or configUSE_SLEEP_MODE_IN_IDLE set to 1 :
* 1 - EM1, 2 - EM2, 3 - EM3, timer in EM3 is not very accurate*/
#define configSLEEP_MODE (
1
)
#define configSLEEP_MODE (
2
)
/* Definition used only if configUSE_TICKLESS_IDLE == 0 */
#define configUSE_SLEEP_MODE_IN_IDLE ( 1 )
...
...
sw/freertos/src/state.c
View file @
7039ad0a
...
...
@@ -33,7 +33,7 @@
#include "blight_task.h"
///> Number of ticks when the watch is considered active since active_reset()
#define ACTIVE_STATE_TICKS
10000
#define ACTIVE_STATE_TICKS
(10000 / portTICK_RATE_MS)
enum
watch_state
current_state
=
IDLE
;
static
xTimerHandle
timer_handle
;
...
...
@@ -87,7 +87,6 @@ static void state_handler(enum watch_state state)
case
IDLE
:
auto_backlight_enable
(
false
);
backlight_set_level
(
0
);
// TODO switch frequency? goto sleep?
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment