Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
Update state_machine.c
Browse files Browse the repository at this point in the history
Add Create and Delete functions
  • Loading branch information
buarmin authored May 17, 2020
1 parent e66241d commit 84eb354
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions state_machine.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#include <stdlib.h>
#include "state_machine.h"

state_machine_t *state_machine_create(void)
{
state_machine_t * machine = NULL;
machine=(state_machine_t*)calloc(1,sizeof(state_machine_t));
return machine;
}

void state_machine_delete(state_machine_t *machine)
{
free(machine);
}


void state_machine_set_current_state(state_machine_t *machine, state_func state)
{
machine->current_state = state;
Expand Down

0 comments on commit 84eb354

Please sign in to comment.