-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement #315
- Loading branch information
Showing
4 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
atmega88_uart_echo.c | ||
This test case enables uart RX interupts, does a "printf" and then receive characters | ||
via the interupt handler until it reaches a \r. | ||
This tests the uart reception fifo system. It relies on the uart "irq" input and output | ||
to be wired together (see simavr.c) | ||
*/ | ||
|
||
#include <avr/io.h> | ||
#include <stdio.h> | ||
#include <avr/interrupt.h> | ||
#include <avr/eeprom.h> | ||
#include <avr/sleep.h> | ||
#include <util/delay.h> | ||
|
||
/* | ||
* This demonstrate how to use the avr_mcu_section.h file | ||
* The macro adds a section to the ELF file with useful | ||
* information for the simulator | ||
*/ | ||
#include "avr_mcu_section.h" | ||
AVR_MCU(16000000, "atmega2560"); | ||
|
||
#define PIN(x,y) PORT##x>>y & 1U | ||
|
||
volatile uint8_t done = 0; | ||
|
||
static int uart_putchar(char c, FILE *stream) | ||
{ | ||
loop_until_bit_is_set(UCSR0A, UDRE0); | ||
UDR0 = c; | ||
return 0; | ||
} | ||
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, | ||
_FDEV_SETUP_WRITE); | ||
int main() | ||
{ | ||
stdout = &mystdout; | ||
sei(); | ||
|
||
printf("READY\n"); | ||
|
||
|
||
while(1){}; | ||
|
||
cli(); | ||
|
||
|
||
printf("FINISHED\n"); | ||
|
||
// this quits the simulator, since interupts are off | ||
// this is a "feature" that allows running tests cases and exit | ||
sleep_cpu(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This script is a component test script for use with the test firmware and printer. | ||
ScriptHost::SetTimeoutMs(2000) | ||
ScriptHost::SetQuitOnTimeout(1) | ||
Serial0::NextLineMustBe(READY) | ||
Board::Reset() | ||
Board::WaitForReset() | ||
Serial0::NextLineMustBe(READY) | ||
Board::Quit() |