Hi Mark,
thank You for Your help again, now its all working, even Win Simulator. I changed My func into application.c and it works..(I had to comment out #define OWN_TASK MY_FIRST_TASK, it was probably biggest problem with simulator). Anyway, when I disable watchdog, I had to change #define CONFIGURE_WATCHDOG 0, because without zero compiler says an error (I found out in the datasheet, that I have to clear bit in CWR, which actually is done after reset).
I get to know with utasker, and it looks really nice...
but I will have some more questions..first, can I still use my own interrupt routines? Or do You have any better sugestion? For example I need to detect press two buttons (let say In and Out). When I press one of them, some status will change and a 5sec. (or so) period will start. In this period second has to be action entered (some input from serial port). If this period overflow without second action, status will change back to 0. If I press second button during this period, status will change to another state (so in this example, I expect three state indicator- zero as nothing to do, 1 as In button pressed and 2 as Out button pressed). So My func will be wake up when button is pressed (interrupt routine will wake up my func with status I described) and if 5sec timer overflow with no serial port input, my func will sleep again with status cleared. If I press another button, my func has to get new status with new timer interval (replace old one) and wait for serial input again. If serial input is done, it will save event, clear timer and sleep again.
Another question- If I want simply connect (buffered TCP/IP), I expect to create connection with function call listen(); or connect(); with IP adress and port like args (I dont know the right names of the function in Your system, but it doesnt matter now, I will find it later). Then I will let My task sleep till "connected event" wake up my task again and I will sort out right event (succesfully connected, connection failed, or so). If its connected, I can send any data by another function datasend(); or datareceived(); (with pointer to data buffer). Is this method right? Or miss I something? Also, will My task sleep till data is sent or received (I expect utasker will wake up it with event data sent or received)? Or have I polling this events? Especially with data received, It will inform Me about every packet received, or just when buffer is full? Maybe My questions are a bit stupid, but I didnt work with utasker (nor with any embedded OS) before..
Anyway, thank You again for Your good job, I dont know about utasker much yet, but I see it will be great get to know it and use it...It must really save time..
Regards, Rad