Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eec646d

Browse files
committedNov 1, 2010
The watchdog sleep method never worked
There were grand plans to set a long-ish watchdog and have it put the machine to a deep sleep when it fired. But this never seemed to work so we remove it. Signed-off-by: Vernon Mauery <vernon@mauery.com>
1 parent 9c08bd2 commit eec646d

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed
 

‎cw-kbd.c

-22
Original file line numberDiff line numberDiff line change
@@ -363,28 +363,6 @@ void power_down(void) {
363363
SREG = imode;
364364
}
365365

366-
#define wdt_interrupt(value) \
367-
__asm__ __volatile__ ( \
368-
"in __tmp_reg__,__SREG__" "\n\t" \
369-
"cli" "\n\t" \
370-
"wdr" "\n\t" \
371-
"sts %0,%1" "\n\t" \
372-
"out __SREG__,__tmp_reg__" "\n\t" \
373-
"sts %0,%2" "\n\t" \
374-
: /* no outputs */ \
375-
: "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \
376-
"r" (_BV(_WD_CHANGE_BIT) | _BV(WDIE)), \
377-
"r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \
378-
_BV(WDIE) | (value & 0x07)) ) \
379-
: "r0" \
380-
)
381-
382-
ISR(WDT_vect) {
383-
wdt_disable();
384-
power_down();
385-
wdt_interrupt(WDTO_8S);
386-
}
387-
388366
static void usb_work(void) {
389367
HID_Device_MillisecondElapsed(&kbd_iface);
390368
HID_Device_USBTask(&kbd_iface);

‎timer.c

+7
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ static t16_mode_t timer3_mode_value = 0;
264264
static timer_callback timer3_capture_callback_ = NULL;
265265
static timer_callback timer3_compare_a_callback_ = NULL;
266266
static timer_callback timer3_compare_b_callback_ = NULL;
267+
static timer_callback timer3_compare_c_callback_ = NULL;
267268
static timer_callback timer3_overflow_callback_ = NULL;
268269

269270
/* Timer 3 Capture event */
@@ -285,6 +286,12 @@ ISR( TIMER3_COMPB_vect )
285286
if( timer3_compare_b_callback_) timer3_compare_b_callback_();
286287
}
287288

289+
/* Timer 3 Compare match B */
290+
ISR( TIMER3_COMPC_vect )
291+
{
292+
if( timer3_compare_c_callback_) timer3_compare_c_callback_();
293+
}
294+
288295
/* Timer 3 Overflow */
289296
ISR( TIMER3_OVF_vect)
290297
{

0 commit comments

Comments
 (0)
Please sign in to comment.