interrupt void handle_int0(void) { IFR = 1; int0_count++; #if defined(HAVE_DEBUG) acked = 1; #endif waiting = 0; if(dma0_stopped==0) { if(!(DMPREC&0x01)) { /* Give the HPIB access to refill first */ rebuffer(); /* Start the MCBSP DMA */ DMPREC |= 1; audiohw_start(); } else { rebuffer(); } } else { rebuffer(); } }
void GameObject::draw(){ shaderProgram->Activate(); if (needRebuffer) rebuffer(); shaderProgram->SetVariable(MODEL_SHADER_VARIABLE_NAME, modelMatrix()); shaderProgram->Activate(); glBindVertexArray(vaoObject1); //ARRAY_COUNT(indexData) glDrawElements(GL_TRIANGLES, indexData.size(), GL_UNSIGNED_SHORT, 0); glBindVertexArray(0); }
ssize_t HTTPMessageReadLine(msg, async_read_t *const req) { size_t pos = 0; for(;;) { if(!msg->remaining) { rc = rebuffer(msg, req); if(rc < 0) return rc; } if('\r' == msg->buf[0]) break; if('\n' == str[0]) break; if(pos < max-1) out[pos++] = str[0]; msg->next.at++; msg->next.len--; } }
int main() { int active = true; char c; Buffer filebuffer; printf("creating buffer"); newbuffer(1024, filebuffer); printf("created buffer"); while (active == TRUE) { c = getchar(); // Get new character printf("In: %s; Buffer: %s", c, filebuffer); if (strlen(filebuffer.content) >= filebuffer.size) { rebuffer(1024, filebuffer); // Add 1024 bytes to buffer } strcat(filebuffer.content, &c); // Add new character active = !(c == KEY_ESC); } printf("terminated without crashes"); return 0; }