Dear all,
My project use RTX base on Cortex-m0 lpc1114. The task1 configure the P0_2 as output and control the led, it works. The task2 configure the P0_1 as clkout pin, and configure the clkout connect to main clock, but it doesn't works.
But clkout pin is ok, when i remove the RTX.
Please help me, Thank you! code: #include <LPC11xx.h> #include <RTL.h>
OS_TID id1, id2 ;
__task void task1(void) ; __task void task2(void) ;
__task void task1(void) { id1 = os_tsk_self() ; id2 = os_tsk_create(task2, 1) ;
for(;;) { os_evt_set(0x0002, id2) ; os_evt_wait_or(0x0004, 0xffff) ; LPC_GPIO0->DATA = 0x00000000 ; os_dly_wait(100) ;
} }
__task void task2(void) { for(;;) { os_evt_wait_or(0x0002, 0xffff) ; LPC_GPIO0->DATA = 0x0000000f ; os_dly_wait(100) ; os_evt_set(0x0004, id1) ;
int main(void) { LPC_GPIO0->DIR = 0x0000000f ; LPC_GPIO0->DATA = 0x0000000f ; LPC_IOCON->RESET_PIO0_0 = 0x00000001 ; LPC_IOCON->PIO0_1 = 0x00000001 ; LPC_IOCON->PIO0_2 = 0x00000011 ; LPC_SYSCON->CLKOUTCLKSEL = 0x00000003 ; LPC_SYSCON->CLKOUTDIV = 0x00000001 ; LPC_SYSCON->CLKOUTUEN = 0x00000000 ; LPC_SYSCON->CLKOUTUEN = 0x00000001 ; os_sys_init(task1) ; }
Thanks for your notification
You're welcome.
Not so hard - is it?!
But first off, the simulator may do something wrong. It isn't the real thing. Just an attempt at behaving identical to the real chip.
The next thing - how do you know that not one of the important important registers aren't either write-protected? And how do you know that os_sys_init() isn't overwriting any of your settings?
About source code - notice that you have still not bothered to repost the source code from your original post, to make it readable. No one will really bother to look closer at that source code, as it is currently garbled because of the lack of the proper tags.
Dear Person Westermark,
#include <LPC11xx.h> #include <RTL.h> OS_TID id1, id2 ; __task void task1(void) ; __task void task2(void) ; __task void task1(void) { id1 = os_tsk_self() ; id2 = os_tsk_create(task2, 1) ; for(;;) { os_evt_set(0x0002, id2) ; os_evt_wait_or(0x0004, 0xffff) ; LPC_GPIO0->DATA = 0x00000000 ; os_dly_wait(100) ; } } __task void task2(void) { for(;;) { os_evt_wait_or(0x0002, 0xffff) ; LPC_GPIO0->DATA = 0x0000000f ; os_dly_wait(100) ; os_evt_set(0x0004, id1) ; } } int main(void) { LPC_GPIO0->DIR = 0x0000000f ; LPC_GPIO0->DATA = 0x0000000f ; L PC_IOCON->RESET_PIO0_0 = 0x00000001 ; LPC_IOCON->PIO0_1 = 0x00000001 ; LPC_IOCON->PIO0_2 = 0x00000011 ; LPC_SYSCON- >CLKOUTCLKSEL = 0x00000003 ; LPC_SYSCON->CLKOUTDIV = 0x00000001 ; LPC_SYSCON->CLKOUTUEN = 0x00000000 ; LPC_SYSCON->CLKOUTUEN = 0x00000001 ; os_sys_init(task1) ; }
IS that really how you lay out your source code?
Do you really think that is clear and easy to read?