Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack: Bad process #280

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions lib/pbio/drv/ioport/ioport_pup.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ void pbdrv_ioport_enable_vcc(bool enable) {
PROCESS(pbdrv_ioport_pup_process, "ioport_pup");
#endif

PROCESS(test_process, "testtest");

void pbdrv_ioport_init(void) {
process_start(&test_process);

init_ports();

#if PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE
Expand All @@ -54,6 +58,29 @@ void pbdrv_ioport_init(void) {
#endif
}

#include <stdio.h>

PROCESS_THREAD(test_process, ev, data) {

static struct etimer timer;

PROCESS_BEGIN();

for (;;) {

etimer_set(&timer, 1000);

// And with this change it still doesn't work after connect, but it
// does get going when you kick it with an event like starting REPL.

PROCESS_WAIT_EVENT_UNTIL(/*ev == PROCESS_EVENT_TIMER &&*/ etimer_expired(&timer));

printf("Hello, world: ev=%d\n", ev);
}

PROCESS_END();
}

void pbdrv_ioport_deinit(void) {
init_ports();

Expand Down
Loading