Is it possible to use NIL without HAL ?
My target is an Arduino uno.
I want to use NIL for the RTOS mechanisms that it offer and want to use my own peripherals implementation.
So here is what I did:
I have bring up all file to have the NIL RTOS in my application. Here is the files:
- nil.c and .h
- nilconf.h
- niicore.c and .h
- niltypes.h
I also have a makefile and a main.c file.
I have include nil in my application and it build successfully.
The main use a thread to blink an LED:
Code: Select all
/*
* Thread 2.
*/
THD_WORKING_AREA(waThread1, 128);
THD_FUNCTION(Thread1, arg) {
(void)arg;
while (true) {
PORTB &= ~(1 << 5);
chThdSleepMilliseconds(500);
PORTB |= (1 << 5);
chThdSleepMilliseconds(2000);
}
}
But it don't work.
I think there is a problem of time that must be use to generate the chThdSleepMilliseconds delay but I'm not sure!
- Did I need to use another file for this?
- Is it possible to do that another way?
Thanks!