added random number generator driver and stuff
This commit is contained in:
38
source/test/rng/main.c
Normal file
38
source/test/rng/main.c
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
/*
|
||||
* main.c
|
||||
*
|
||||
* Created on: Aug 2, 2016
|
||||
* Author: tkl
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "driver.h"
|
||||
#include "board.h"
|
||||
#include "stack.h"
|
||||
#include "queue.h"
|
||||
#include "kernel.h"
|
||||
#include "driver.h"
|
||||
#include "list.h"
|
||||
#include "shell.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char print_buffer[50];
|
||||
shell_init(&uart_1);
|
||||
drv_open(&rng);
|
||||
|
||||
while(1) {
|
||||
int random = drv_read(&rng, NULL, 0);
|
||||
sprintf(print_buffer, "random: %d\r\n", random);
|
||||
shell_write(print_buffer, strlen(print_buffer));
|
||||
sleep_ms(1000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
1
source/test/rng/rng.mk
Normal file
1
source/test/rng/rng.mk
Normal file
@@ -0,0 +1 @@
|
||||
SRC_DIR += source/test/rng
|
Reference in New Issue
Block a user