enad
March 23, 2007, 12:58pm
1
Hi !
Im setting one output pin to act as impuls output ( low - high -low ).
The output pin is 19 and delay between L-H is set to 1 second.
Im not sure how is this working in openAT but i have tryed with and without unsubscribe after each high - low.
Im getting -4 ( ADL_RET_ERR_ALREADY_SUBSCRIBED ) all the time.
while(sec=5){
TRACE ((1, "-- PULSE HIGH --"));
adl_ioWriteSingle ( myGpioHandle3, ADL_IO_Q2686_GPIO_19, ADL_IO_HIGH);
adl_ioUnsubscribe ( myGpioHandle3 );
sleep(1);
TRACE ((1, "-- PULSE LOW --"));
adl_ioWriteSingle ( myGpioHandle3, ADL_IO_Q2686_GPIO_19, ADL_IO_LOW);
adl_ioUnsubscribe ( myGpioHandle3 );
adl_ioUnsubscribe ( myGpioEventHandle );
}
In both ways im getting OAT task index : 0 and application is restarted ( watchdog reset ).
Trace 30 SIM event 3
Trace 23 [ADL] Gpio Single Write -4 : -2
Trace 1 – PULSE LOW –
Trace 23 [ADL] Gpio unsubs -4 : -3
Trace 23 [ADL] Gpio unsubs 0 : -3
Trace 23 [ADL] Gpio Single Write -4 : -2
Trace 1 – PULSE HIGH –
Trace 23 [ADL] Gpio unsubs -4 : -3
Trace 23 [ADL] Gpio Single Write -4 : -2
Trace 1 – PULSE LOW –
Trace 23 [ADL] Gpio unsubs -4 : -3
Trace 23 [ADL] Gpio unsubs 0 : -3
Trace 23 [ADL] Gpio Single Write -4 : -2
Trace 1 – PULSE HIGH –
Trace 23 [ADL] Gpio unsubs -4 : -3
Trace 23 [ADL] Gpio Single Write -4 : -2
Trace 30 [ADL PORT] subs (002127B1) : 0
Trace 20 [ADL] tmr subs ; id 0 ; hdlr 002111D5 ; val 10 ; cycl 0
Trace 30 [ADL PORT] event : 0 (port 80 ; state 0)
Trace 30 [ADL PORT] event : 0 (port 01 ; state 0)
Trace 1 OAT Task index : 0
Trace 1 Watch dog reset. Tsk 27
Trace 22 [ADL] flash subs 1 : -4
Trace 22 Flh Obj 0000 Len : 4
Trace 22 Read Flh Obj 0000 (4) : 0
Trace 30 SIM subs 00211FD1
Trace 27 Call subs 00210619 : 0
Trace 30 SIM subs 00210561
Trace 20 [ADL] tmr subs ; id 4 ; hdlr 00216F8D ; val 5 ; cycl 0
Trace 30 SIM event 2
Trace 30 SIM event 5
Trace 30 SIM event 3
Emil
tobias
March 23, 2007, 1:36pm
2
Are you sure the -4 you look at in the trace log is the return value of the functions?
It would make more sense if it’s the other value.
I’m not sure what you are trying to accomplish with the code you supply…
adl_ioUnsubscribe ( myGpioEventHandle ); <-- you can’t use that function to unsubscribe an event handler
sleep(1); <-- what’s this? “busy-loop sleep”?
while(sec=5) <-- assignment in the while condition??
I can’t give any help with the code that has been supplied…
enad
March 23, 2007, 2:06pm
3
sleep(1); <-- what’s this? “busy-loop sleep”?
– It’s is used as delay between switching Low-High.
while(sec=5) <-- assignment in the while condition?
– Just test…
Are you sure the -4 you look at in the trace log is the return value of the functions
– I will try one more thing than i get back to you.
tobias
March 23, 2007, 2:18pm
4
The following would be a better way to do it imo:
subscribe gpio
start timer1
when timer1 triggers, write high to the output and start timer2 with 1 second
when timer2 triggers, write low to the output and call whatever is supposed to be called after the pulse
start timer1 again whenever you want the pulse.
enad
March 23, 2007, 2:33pm
5
OK. I will try your suggestion today.
Forget to mention that i have 3 GPIO’s that i have to contol.
Maybe are those gpios set for lcd or for something else, on the demo board ( Glyn Evbq).
Btw. this is what i get when i run the example from the adl user guide:
Trace 30 SIM event 3
Trace 30 [ADL PORT] subs (002125AD) : 0
Trace 20 [ADL] tmr subs ; id 0 ; hdlr 00210FD1 ; val 10 ; cycl 0
Trace 30 [ADL PORT] event : 0 (port 80 ; state 0)
Trace 30 [ADL PORT] event : 0 (port 01 ; state 0)
Trace 22 [ADL] flash subs 1 : -4
Trace 22 Flh Obj 0000 Len : 4
Trace 22 Read Flh Obj 0000 (4) : 0
Trace 30 SIM subs 00211DCD
Trace 27 Call subs 0021041D : 0
Trace 30 SIM subs 00210365
Trace 20 [ADL] tmr subs ; id 1 ; hdlr 00216CC1 ; val 5 ; cycl 0
Trace 20 [ADL] tmr subs ; id 2 ; hdlr 00216CC1 ; val 5 ; cycl 0
Trace 20 [ADL] tmr subs ; id 3 ; hdlr 00216CC1 ; val 5 ; cycl 0
Trace 20 [ADL] tmr subs ; id 4 ; hdlr 00216CC1 ; val 5 ; cycl 0
Trace 30 SIM event 2
Trace 30 SIM event 5
Trace 20 [ADL] tmr subs ; id 5 ; hdlr 00213BD5 ; val 30 ; cycl 0
Trace 20 [ADL] tmr subs ; id 6 ; hdlr 002103E1 ; val 10 ; cycl 1
Trace 20 [ADL] tmr unsubs ; id 6 ; hdlr 002103E1 (rem. time : 6)
Trace 23 [ADL] Gpio Event subs 002102E5 : 0
Trace 23 [ADL] Gpio subs 2 0 : -4
Trace 20 [ADL] tmr subs ; id 7 ; hdlr 00215735 ; val 1 ; cycl 1
Trace 23 [ADL] Gpio subs 1 1 : 5
Trace 23 [ADL] Gpio Single Write -4 : -2
Trace 23 [ADL] Gpio Single Read -4 : -2
Trace 23 [ADL] Gpio Single Read 5 : 1
Trace 23 [ADL] Gpio unsubs -4 : -3
Trace 20 [ADL] tmr unsubs ; id 7 ; hdlr 00215735 (rem. time : -1)
Trace 23 [ADL] Gpio unsubs 5 : 0
Trace 23 [ADL] Gpio unsubs 0 : -3
Trace 30 SIM event 3
Emil