Skip to content

Commit

Permalink
Merge pull request #21 from LudwigOrtmann/native_cc1100_tap
Browse files Browse the repository at this point in the history
native cc110x_ng support
  • Loading branch information
OlegHahm committed Aug 15, 2013
2 parents dc5e7d7 + d726441 commit 49c5e41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions native/drivers/native-uart0.c
Expand Up @@ -27,6 +27,10 @@ void _native_handle_uart0_input()
char buf[42];
int nread;

if (!FD_ISSET(_native_uart_in, &_native_rfds)) {
DEBUG("_native_handle_uart0_input - nothing to do\n");
return;
}
DEBUG("_native_handle_uart0_input\n");
_native_in_syscall = 0;
_native_in_isr = 1;
Expand All @@ -44,15 +48,18 @@ void _native_handle_uart0_input()
cpu_switch_context_exit();
}

int _native_set_uart_fds(void)
{
DEBUG("_native_set_uart_fds");
FD_SET(_native_uart_in, &_native_rfds);
return _native_uart_in;
}

void _native_init_uart0()
{
_native_uart_out = STDOUT_FILENO;
_native_uart_in = STDIN_FILENO;

/* set fds for select in lpm */
FD_ZERO(&_native_uart_rfds);
FD_SET(_native_uart_in, &_native_uart_rfds);

puts("RIOT native uart0 initialized.");
}

Expand Down
2 changes: 1 addition & 1 deletion native/include/board_internal.h
@@ -1,6 +1,6 @@
#ifdef MODULE_UART0
#include <sys/select.h>
extern fd_set _native_uart_rfds;
void _native_handle_uart0_input(void);
void _native_init_uart0(void);
int _native_set_uart_fds(void);
#endif

0 comments on commit 49c5e41

Please sign in to comment.