Skip to content

Commit

Permalink
task: fix unit tests after port to attiny88
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisstjohn committed Nov 20, 2023
1 parent 7bbf8f6 commit 9b2d89a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions soft/lib/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void task_main(void)
sleep_enable();

/* We use TIMER0 with Counter A and /256 prescaler */
#if TARGET_MCU == attiny88
#if defined(__AVR_ATtiny48__) || defined(__AVR_ATtiny88__)
TCCR0A = 0x04; /* /256 */
#else
TCCR0A = 0x02; /* OCRA */
Expand All @@ -119,7 +119,7 @@ void task_main(void)
OCR0A = (uint8_t)(TIMER_SYSCLK_256_2ms/2)-1;

/* Raise interrupt on Compare Match A */
#if TARGET_MCU == attiny88
#if defined(__AVR_ATtiny48__) || defined(__AVR_ATtiny88__)
TIMSK0 = 1<<OCIE0A;
#else
TIMSK = 1<<OCIE0A;
Expand Down
2 changes: 1 addition & 1 deletion soft/sample/blinky/pwm.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @endcode
*/

#if TARGET_MCU == attiny88
#if defined(__AVR_ATtiny48__) || defined(__AVR_ATtiny88__)
# define PWM_GPIOS(_) _(B, 0) _(B, 1) _(B, 2) _(B, 3) _(B, 4) _(D, 0)
#else
# define PWM_GPIOS(_) _(B, 0) _(B, 1) _(B, 2) _(B, 3) _(B, 4) _(B, 5)
Expand Down
2 changes: 2 additions & 0 deletions soft/test/stubs/avr/sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ extern unsigned char TCNT0;
extern unsigned char OCR0A;
extern unsigned char TIMSK;

#define OCIE0A 4

extern unsigned F_CPU;

0 comments on commit 9b2d89a

Please sign in to comment.