
#ifndef elec_task_slot_h__
#define elec_task_slot_h__

#include "board.h"

#pragma pack (1)
typedef struct{
  uint8_t slot_index;
  uint8_t task_id;
  uint8_t par_count;// 参数个数
  uint8_t ret_count;// 返回值个数
  uint8_t errcode;
  uint8_t task_index;
  uint8_t exe_flag;// 此项为1则已执行
  uint8_t params[20];
  uint8_t rets[20];
}task_def;
#pragma pack ()

void *task_slot_init(void);

void task_slot_delete(void);

int task_slot_add_item(void *context,task_def *item);

task_def *task_slot_next(void *context,uint8_t slot_index);

task_def *task_slot_next_item(void *context);

int task_slot_add_err(void *context,uint8_t err);

int task_slot_err_table(void *context,uint8_t **table);

#endif


