Skip to content

Commit

Permalink
runtime: blink LED at startup
Browse files Browse the repository at this point in the history
sbourdeauducq committed Sep 15, 2014
1 parent 140b4eb commit 040fa0e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions soc/runtime/main.c
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
#include <irq.h>
#include <uart.h>
#include <system.h>
#include <time.h>
#include <generated/csr.h>

#include "corecom.h"
#include "elf_loader.h"
@@ -77,6 +79,20 @@ static int run_kernel(const char *kernel_name)
return 1;
}

static void blink_led(void)
{
int i, ev, p;

p = identifier_frequency_read()/10;
time_init();
for(i=0;i<3;i++) {
leds_out_write(1);
while(!elapsed(&ev, p));
leds_out_write(0);
while(!elapsed(&ev, p));
}
}

int main(void)
{
irq_setmask(0);
@@ -85,6 +101,7 @@ int main(void)

puts("ARTIQ runtime built "__DATE__" "__TIME__"\n");
dds_init();
blink_led();
corecom_serve(load_object, run_kernel);
return 0;
}

0 comments on commit 040fa0e

Please sign in to comment.