sync with current state
This commit is contained in:
6
apps/c-src/99-fbdev.conf
Normal file
6
apps/c-src/99-fbdev.conf
Normal file
@ -0,0 +1,6 @@
|
||||
Section "Device"
|
||||
Identifier "myfb"
|
||||
Driver "fbdev"
|
||||
Option "fbdev" "/dev/fb0"
|
||||
EndSection
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <threads.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int Nx, Ny;
|
||||
@ -156,7 +156,7 @@ int PFT_HandlePixelflutMessage(uint8_t *buffer, int size, int sock){
|
||||
return begin-(char*)buffer;
|
||||
}
|
||||
|
||||
int PFT_HandleClient(void* sock_){
|
||||
void* PFT_HandleClient(void* sock_){
|
||||
int sock = (int)(size_t)sock_;
|
||||
PFT_ClientThreadCount++;
|
||||
uint8_t buf[1024];
|
||||
@ -172,7 +172,7 @@ int PFT_HandleClient(void* sock_){
|
||||
}
|
||||
|
||||
|
||||
int PFT_RunServer(void* _){
|
||||
void* PFT_RunServer(void* _){
|
||||
int client_sock;
|
||||
socklen_t addr_len;
|
||||
struct sockaddr_in addr;
|
||||
@ -220,9 +220,9 @@ int PFT_RunServer(void* _){
|
||||
while(1){
|
||||
client_sock = accept(server_sock, (struct sockaddr*)&addr, &addr_len);
|
||||
if(client_sock > 0){
|
||||
thrd_t thread;
|
||||
thrd_create(&thread, PFT_HandleClient, (void*)(size_t)client_sock);
|
||||
thrd_detach(thread);
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, PFT_HandleClient, (void*)(size_t)client_sock);
|
||||
pthread_detach(thread);
|
||||
}
|
||||
}
|
||||
close(server_sock);
|
||||
@ -235,8 +235,8 @@ int main(int argc, char **argv) {
|
||||
buf = (uint8_t*)malloc(Nx*Ny*3);
|
||||
port = atoi(argv[3]);
|
||||
if (port == 0) port = 4444;
|
||||
thrd_t thread;
|
||||
thrd_create(&thread, PFT_RunServer, NULL);
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, PFT_RunServer, NULL);
|
||||
|
||||
|
||||
|
||||
@ -245,4 +245,4 @@ int main(int argc, char **argv) {
|
||||
usleep(33*1000);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user