Hi Oliver,
please provide more information, e.g. the board you are using including
Makefile for your app.
Best Regards
Robert
On 01.08.19 13:36, oliver wrote:
> Dear RIOT Team,
>
> the function "timer_init" does not work. The function returns 0. So my
> function call is correct.
> But the ISR function is never called. Why ?
> I have read the doc but found nothing to solve the problem.
> Did i forget something ?
>
> My Code:
> ===========================================================
>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <inttypes.h>
> #include "board.h"
> #include "periph/gpio.h"
> #include "periph_conf.h"
> #include "led.h"
> #include "shell.h"
> #include "thread.h"
> #include "periph/i2c.h"
> #include "xtimer.h"
> #include "periph/timer.h"
>
>
>
> char stack[THREAD_STACKSIZE_MAIN];
>
> static const shell_command_t commands[] = {
> { NULL, NULL, NULL }
> };
>
> void ISR_timer(void* arg, int argc){
>
> printf("ISR running\n");
> (void)arg;
> (void)argc;
> }
>
> int main(void)
> {
> xtimer_sleep(1);
>
> printf("starte Timer\n");
> int returnval = timer_init(0,1,&ISR_timer,NULL); //1 Hz
> printf("return = %d\n",returnval);
>
>
>
> char line_buf[SHELL_DEFAULT_BUFSIZE];
> shell_run(commands, line_buf, SHELL_DEFAULT_BUFSIZE);
>
> return 0;
> }
> ===================================================================
>
>
--
Robert Hartung, M.Sc.
Technische Universität Braunschweig
Institut für Betriebssysteme und Rechnerverbund
Mühlenpfordtstr. 23, Raum 115
38106 Braunschweig
Fon: +49 (531) 391 - 3264
Fax: +49 (531) 391 - 5936
E-Mail: [email protected]
_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users