Ejemplo n.º 1
0
static uint8_t getType(uint16_t index)
{
	int8_t arrayPos = convertToArrayPos(index);
	if (arrayPos < 0)
		return 0;

	return types[arrayPos];
}
Ejemplo n.º 2
0
static void setType(uint16_t index, uint8_t type)
{
	int8_t arrayPos = convertToArrayPos(index);
	if (arrayPos < 0)
		return;

	types[arrayPos] = type;
}
Ejemplo n.º 3
0
static void setDate(uint16_t index, char *name)
{
	int8_t arrayPos = convertToArrayPos(index);
	if (arrayPos < 0)
		return;

	strcpy(dates[arrayPos],name);
}
Ejemplo n.º 4
0
static char* getDate(uint16_t index)
{
	int8_t arrayPos = convertToArrayPos(index);
	if (arrayPos < 0)
		return "";

	return dates[arrayPos];
}
Ejemplo n.º 5
0
static char* getNumber(uint16_t index)
{
	int8_t arrayPos = convertToArrayPos(index);
	if (arrayPos < 0)
		return "";

	return numbers[arrayPos];
}
Ejemplo n.º 6
0
bool cb_isLoaded(CircularBuffer* buffer, uint16_t index)
{
    int8_t bufferPosition = convertToArrayPos(buffer, index);
    if (bufferPosition < 0)
        return false;

    return buffer->loaded[bufferPosition];
}
Ejemplo n.º 7
0
void* cb_getEntryForFilling(CircularBuffer* buffer, uint16_t index)
{
    int8_t bufferPosition = convertToArrayPos(buffer, index);
    if (bufferPosition < 0)
        return NULL;

    buffer->loaded[bufferPosition] = true;

    return (void*) &buffer->data[buffer->singleEntrySize * bufferPosition];
}