*/
static DECLARE_ISR(adc_conversion_end_irq)
{
- sig_signal(adc_process, SIG_ADC_COMPLETE);
+ sig_post(adc_process, SIG_ADC_COMPLETE);
/* Inform hw that we have served the IRQ */
AIC_EOICR = 0;
*/
ISR(ADC_vect)
{
- sig_signal(adc_process, SIG_ADC_COMPLETE);
+ sig_post(adc_process, SIG_ADC_COMPLETE);
}
#endif /* CONFIG_KERN */
{ \
struct Process *main_proc = (struct Process *) proc_currentUserData(); \
kputs("> Process: " #num "\n"); \
- sig_signal(main_proc, SIG_USER##num); \
+ sig_send(main_proc, SIG_USER##num); \
}
// Default priority is 0
* These macros generate the code needed to create the test process functions.
*/
#define PROC_TEST_SLAVE(index, signal) \
-static void NORETURN proc_signalTest##index(void) \
+static void proc_signalTest##index(void) \
{ \
- for(;;) \
- { \
- kputs("> Slave [" #index "]: Wait signal [" #signal "]\n"); \
- sig_wait(signal); \
- kputs("> Slave [" #index "]: send signal [" #signal "]\n"); \
- sig_signal(proc_currentUserData(), signal); \
- } \
+ kputs("> Slave [" #index "]: Wait signal [" #signal "]\n"); \
+ sig_wait(signal); \
+ kputs("> Slave [" #index "]: send signal [" #signal "]\n"); \
+ sig_send(proc_currentUserData(), signal); \
}
#define MAIN_CHECK_SIGNAL(index, slave) \
do { \
kprintf("> Main: send signal [%d]\n", test_signal[index]); \
- sig_signal(slave, test_signal[index]); \
+ sig_send(slave, test_signal[index]); \
kprintf("> Main: wait signal [%d]\n", test_signal[index]); \
sig_wait(test_signal[index]); \
count++; \
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
void event_hook_signal(Event *e)
{
- sig_signal((e)->Ev.Sig.sig_proc, (e)->Ev.Sig.sig_bit);
+ sig_post((e)->Ev.Sig.sig_proc, (e)->Ev.Sig.sig_bit);
}
#endif
avr-kern_USER_CSRC = \
examples/avr-kern/main.c \
bertos/kern/proc_test.c \
+ bertos/kern/signal_test.c \
bertos/mware/sprintf.c \
#
#include <cpu/irq.h>
#include <drv/timer.h>
#include <kern/proc.h>
+#include <kern/signal.h>
#include <stdio.h>
static void init(void)
kputs("\n");
proc_testRun();
+ signal_testRun();
while (1)
cpu_relax();
while (1)
{
- sig_signal(p, SIG_USER0);
+ sig_send(p, SIG_USER0);
proc_yield();
}
Msg *msg_re = msg_get(&in_port);
msg_reply(msg_re);
// generate code for signals
- sig_signal(p, SIG_USER0);
+ sig_send(p, SIG_USER0);
sig_wait(SIG_USER0);
return 0;