Remove all tabs
This commit is contained in:
parent
d4300c9c04
commit
18fb916834
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
void chan_init(chan_t *c)
|
void chan_init(chan_t *c)
|
||||||
{
|
{
|
||||||
if(c == NULL) return;
|
if (c == NULL) return;
|
||||||
|
|
||||||
pthread_mutex_init(&c->m_meta, NULL);
|
pthread_mutex_init(&c->m_meta, NULL);
|
||||||
pthread_mutex_init(&c->m_read, NULL);
|
pthread_mutex_init(&c->m_read, NULL);
|
||||||
|
|
@ -38,7 +38,7 @@ void chan_send(chan_t *c, void *data)
|
||||||
pthread_mutex_lock(&c->m_write);
|
pthread_mutex_lock(&c->m_write);
|
||||||
pthread_mutex_lock(&c->m_meta);
|
pthread_mutex_lock(&c->m_meta);
|
||||||
|
|
||||||
if(c->closed)
|
if (c->closed)
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&c->m_meta);
|
pthread_mutex_unlock(&c->m_meta);
|
||||||
pthread_mutex_unlock(&c->m_write);
|
pthread_mutex_unlock(&c->m_write);
|
||||||
|
|
@ -69,14 +69,14 @@ void chan_recv(chan_t *c, void **data)
|
||||||
pthread_mutex_lock(&c->m_meta);
|
pthread_mutex_lock(&c->m_meta);
|
||||||
|
|
||||||
// wait for a writer
|
// wait for a writer
|
||||||
while(!c->closed && !c->writer)
|
while (!c->closed && !c->writer)
|
||||||
{
|
{
|
||||||
c->reader = true;
|
c->reader = true;
|
||||||
pthread_cond_wait(&c->c_writer, &c->m_meta);
|
pthread_cond_wait(&c->c_writer, &c->m_meta);
|
||||||
c->reader = false;
|
c->reader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(c->closed)
|
if (c->closed)
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&c->m_meta);
|
pthread_mutex_unlock(&c->m_meta);
|
||||||
pthread_mutex_unlock(&c->m_read);
|
pthread_mutex_unlock(&c->m_read);
|
||||||
|
|
|
||||||
|
|
@ -242,10 +242,10 @@ void sdl_task()
|
||||||
pthread_mutex_unlock(&mu);
|
pthread_mutex_unlock(&mu);
|
||||||
|
|
||||||
SDL_Event ev = { 0 };
|
SDL_Event ev = { 0 };
|
||||||
while(!Radio_State.PowerOff)
|
while (!Radio_State.PowerOff)
|
||||||
{
|
{
|
||||||
keyboard_t key = 0;
|
keyboard_t key = 0;
|
||||||
if(SDL_PollEvent(&ev) == 1)
|
if (SDL_PollEvent(&ev) == 1)
|
||||||
{
|
{
|
||||||
switch (ev.type)
|
switch (ev.type)
|
||||||
{
|
{
|
||||||
|
|
@ -269,7 +269,7 @@ void sdl_task()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( ev.type == SDL_Screenshot_Event)
|
if (ev.type == SDL_Screenshot_Event)
|
||||||
{
|
{
|
||||||
char *filename = (char *)ev.user.data1;
|
char *filename = (char *)ev.user.data1;
|
||||||
screenshot_display(filename);
|
screenshot_display(filename);
|
||||||
|
|
@ -282,7 +282,8 @@ void sdl_task()
|
||||||
{
|
{
|
||||||
PIXEL_SIZE *pixels;
|
PIXEL_SIZE *pixels;
|
||||||
int pitch = 0;
|
int pitch = 0;
|
||||||
if (SDL_LockTexture(displayTexture, NULL, (void **) &pixels, &pitch) < 0)
|
if (SDL_LockTexture(displayTexture, NULL,
|
||||||
|
(void **) &pixels, &pitch) < 0)
|
||||||
{
|
{
|
||||||
SDL_Log("SDL_lock failed: %s", SDL_GetError());
|
SDL_Log("SDL_lock failed: %s", SDL_GetError());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue