implementation {
uint8_t free;
uint8_t index;
- pool_t* queue[size];
+ pool_t* ONE_NOK queue[size];
pool_t pool[size];
command error_t Init.init() {
}
command bool Pool.empty() {
+ dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
return free == 0;
}
command uint8_t Pool.size() {
+ dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
return free;
}
if (index == size) {
index = 0;
}
+ dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
return rval;
}
return NULL;
return FAIL;
}
else {
- uint8_t emptyIndex = (index + free);
+ uint16_t emptyIndex = (index + free);
if (emptyIndex >= size) {
emptyIndex -= size;
}
queue[emptyIndex] = newVal;
free++;
+ dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
return SUCCESS;
}
}