X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fsystem%2FPoolP.nc;h=9011d6cfd273898c93c904d0fde6c6a4e3fffd1f;hb=267875ef02b9446e463c6f48b0930694f1b86716;hp=c7198505a2480875ae58d24df573ccd187671561;hpb=b21ba62c1963284eb820ad80adcde4a51afd3e6b;p=tinyos-2.x.git diff --git a/tos/system/PoolP.nc b/tos/system/PoolP.nc index c7198505..9011d6cf 100644 --- a/tos/system/PoolP.nc +++ b/tos/system/PoolP.nc @@ -73,9 +73,11 @@ implementation { } 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; } @@ -92,6 +94,7 @@ implementation { if (index == size) { index = 0; } + dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free); return rval; } return NULL; @@ -102,12 +105,13 @@ implementation { 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; } }