/*
 * cfg_state.c
 *
 *  Created on: 22-02-2017
 *      Author:
 */


#include "cfg_state.h"

#include "helper.h"

int state_initlog(void *arguments, void *logic)
{
	struct state_args *args = (struct state_args *)arguments;
	struct state_logic *log = (struct state_logic *)logic;

	if(set_bit_ptr_mask(args->io.out,&log->out_bit,&log->out_bit_mask))
		return -1;

	if (args->params.bity)
		*log->out_bit |= log->out_bit_mask;
	else
		*log->out_bit &= ~log->out_bit_mask;

	return 0;
}
