Skip to content

Commit

Permalink
contiki: drop process_start data arg
Browse files Browse the repository at this point in the history
This argument is always NULL so we can remove it.
  • Loading branch information
dlech committed Jun 29, 2021
1 parent 1473c4b commit 21d98ad
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lib/contiki-core/sys/autostart.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ autostart_start(struct process * const processes[])
int i;

for(i = 0; processes[i] != NULL; ++i) {
process_start(processes[i], NULL);
process_start(processes[i]);
PRINTF("autostart_start: starting process '%s'\n", processes[i]->name);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/contiki-core/sys/ctimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ctimer_init(void)
{
initialized = 0;
list_init(ctimer_list);
process_start(&ctimer_process, NULL);
process_start(&ctimer_process);
}
/*---------------------------------------------------------------------------*/
void
Expand Down
4 changes: 2 additions & 2 deletions lib/contiki-core/sys/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ process_alloc_event(void)
}
/*---------------------------------------------------------------------------*/
void
process_start(struct process *p, process_data_t data)
process_start(struct process *p)
{
struct process *q;

Expand All @@ -118,7 +118,7 @@ process_start(struct process *p, process_data_t data)
PRINTF("process: starting '%s'\n", PROCESS_NAME_STRING(p));

/* Post a synchronous initialization event to the process. */
process_post_synch(p, PROCESS_EVENT_INIT, data);
process_post_synch(p, PROCESS_EVENT_INIT, NULL);
}
/*---------------------------------------------------------------------------*/
static void
Expand Down
6 changes: 1 addition & 5 deletions lib/contiki-core/sys/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,8 @@ struct process {
* Start a process.
*
* \param p A pointer to a process structure.
*
* \param data An argument pointer that can be passed to the new
* process
*
*/
CCIF void process_start(struct process *p, process_data_t data);
CCIF void process_start(struct process *p);

/**
* Post an asynchronous event.
Expand Down
2 changes: 1 addition & 1 deletion lib/contiki-core/sys/procinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ procinit_init(void)
int i;

for(i = 0; procinit[i] != NULL; ++i) {
process_start((struct process *)procinit[i], NULL);
process_start((struct process *)procinit[i]);
}
}
/*---------------------------------------------------------------------------*/
2 changes: 1 addition & 1 deletion lib/contiki-core/sys/subprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{ \
static struct process subprocess_subprocess = {NULL, strname}; \
subprocess_subprocess.thread = PROCESS_CURRENT()->thread; \
process_start(&subprocess_subprocess, NULL); \
process_start(&subprocess_subprocess); \
PT_INIT(&subprocess_subprocess.pt); \
LC_SET(subprocess_subprocess.pt.lc); \
if(PROCESS_CURRENT() == &subprocess_subprocess) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void schedule_timer(void) {
}

static void btstack_run_loop_contiki_init(void) {
process_start(&btstack_run_loop_contiki_process, NULL);
process_start(&btstack_run_loop_contiki_process);
}

static void btstack_run_loop_contiki_add_data_source(btstack_data_source_t *ds) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/drv/bluetooth/bluetooth_stm32_bluenrg.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void pbdrv_bluetooth_init(void) {

void pbdrv_bluetooth_power_on(bool on) {
if (on) {
process_start(&pbdrv_bluetooth_spi_process, NULL);
process_start(&pbdrv_bluetooth_spi_process);
} else {
// REVISIT: should probably gracefully shutdown in case we are in the
// middle of something
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/drv/bluetooth/bluetooth_stm32_cc2640.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void pbdrv_bluetooth_init(void) {

void pbdrv_bluetooth_power_on(bool on) {
if (on) {
process_start(&pbdrv_bluetooth_spi_process, NULL);
process_start(&pbdrv_bluetooth_spi_process);
} else {
// REVISIT: should probably gracefully shutdown in case we are in the
// middle of something
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/drv/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ uint32_t pbdrv_init_busy_count;
void pbdrv_init(void) {
clock_init();
process_init();
process_start(&etimer_process, NULL);
process_start(&etimer_process);
pbdrv_battery_init();
pbdrv_bluetooth_init();
pbdrv_counter_init();
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/drv/ioport/ioport_lpf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ PROCESS(pbdrv_ioport_lpf2_process, "I/O port");
static ioport_dev_t ioport_devs[PBDRV_CONFIG_IOPORT_LPF2_NUM_PORTS];

void pbdrv_ioport_lpf2_init(void) {
process_start(&pbdrv_ioport_lpf2_process, NULL);
process_start(&pbdrv_ioport_lpf2_process);
}

void pbdrv_ioport_lpf2_shutdown(void) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/drv/pwm/pwm_tlc5955_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void pbdrv_pwm_tlc5955_stm32_init(pbdrv_pwm_dev_t *devs) {
pbdrv_init_busy_up();
}

process_start(&pwm_tlc5955_stm32, NULL);
process_start(&pwm_tlc5955_stm32);
}

// toggles LAT signal on and off to latch data in shift register
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/src/light/animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void pbio_light_animation_start(pbio_light_animation_t *animation) {
animation->next_animation = pbio_light_animation_list_head;
pbio_light_animation_list_head = animation;

process_start(&pbio_light_animation_process, NULL);
process_start(&pbio_light_animation_process);
// HACK: init timer since we don't call etimer_set()
timer_set(&animation->timer.timer, 0);
// fake a timer event to load the first cell and start the timer
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/sys/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void pbsys_bluetooth_init(void) {

lwrb_init(&uart_tx_ring, uart_tx_buf, PBIO_ARRAY_SIZE(uart_tx_buf));
lwrb_init(&uart_rx_ring, uart_rx_buf, PBIO_ARRAY_SIZE(uart_rx_buf));
process_start(&pbsys_bluetooth_process, NULL);
process_start(&pbsys_bluetooth_process);
}

static void on_event(void) {
Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/test/drv/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ PROCESS_THREAD(test_uart_send_process, ev, data) {

static int test_uart_block_init(const btstack_uart_config_t *uart_config) {
log_debug("%s", __func__);
process_start(&test_uart_receive_process, NULL);
process_start(&test_uart_send_process, NULL);
process_start(&test_uart_receive_process);
process_start(&test_uart_send_process);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/test/src/servo.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static PT_THREAD(test_servo_run_func(struct pt *pt, const char *name, pbio_error

PT_BEGIN(pt);

process_start(&pbio_motor_process, NULL);
process_start(&pbio_motor_process);
tt_want(process_is_running(&pbio_motor_process));

tt_uint_op(pbio_motor_process_get_servo(PBIO_PORT_ID_A, &servo), ==, PBIO_SUCCESS);
Expand Down
8 changes: 4 additions & 4 deletions lib/pbio/test/src/uartdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static PT_THREAD(test_boost_color_distance_sensor(struct pt *pt)) {

PT_BEGIN(pt);

process_start(&pbio_uartdev_process, NULL);
process_start(&pbio_uartdev_process);

// starting baud rate of hub
PT_WAIT_UNTIL(pt, {
Expand Down Expand Up @@ -507,7 +507,7 @@ static PT_THREAD(test_boost_interactive_motor(struct pt *pt)) {

PT_BEGIN(pt);

process_start(&pbio_uartdev_process, NULL);
process_start(&pbio_uartdev_process);

// starting baud rate of hub
PT_WAIT_UNTIL(pt, {
Expand Down Expand Up @@ -695,7 +695,7 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) {

PT_BEGIN(pt);

process_start(&pbio_uartdev_process, NULL);
process_start(&pbio_uartdev_process);

// baud rate for sync messages
PT_WAIT_UNTIL(pt, {
Expand Down Expand Up @@ -903,7 +903,7 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) {

PT_BEGIN(pt);

process_start(&pbio_uartdev_process, NULL);
process_start(&pbio_uartdev_process);

// baud rate for sync messages
PT_WAIT_UNTIL(pt, {
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/test/sys/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROCESS_THREAD(status_test_process, ev, data) {
static PT_THREAD(test_status(struct pt *pt)) {
PT_BEGIN(pt);

process_start(&status_test_process, NULL);
process_start(&status_test_process);

// use the last valid flag for edge case
static const pbio_pybricks_status_t test_flag = NUM_PBIO_PYBRICKS_STATUS - 1;
Expand Down

0 comments on commit 21d98ad

Please sign in to comment.