mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
imagedata is now allocated on the heap
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
#include "loadPattern.h"
|
#include "loadPattern.h"
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h> // usleep
|
#include <unistd.h> // usleep
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
@ -2258,8 +2259,9 @@ void *start_timer(void *arg) {
|
|||||||
int packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
int packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||||
|
|
||||||
// Generate Data
|
// Generate Data
|
||||||
char imageData[imageSize]; //
|
char *imageData = (char *)malloc(imageSize);
|
||||||
memset(imageData, 0, imageSize);
|
memset(imageData, 0, imageSize);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
for (int i = 0; i < imageSize; i += sizeof(uint16_t)) {
|
for (int i = 0; i < imageSize; i += sizeof(uint16_t)) {
|
||||||
*((uint16_t *)(imageData + i)) = i;
|
*((uint16_t *)(imageData + i)) = i;
|
||||||
@ -2325,6 +2327,8 @@ void *start_timer(void *arg) {
|
|||||||
setNextFrameNumber(frameNr + numFrames);
|
setNextFrameNumber(frameNr + numFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(imageData);
|
||||||
|
|
||||||
closeUDPSocket(0);
|
closeUDPSocket(0);
|
||||||
|
|
||||||
sharedMemory_setStatus(IDLE);
|
sharedMemory_setStatus(IDLE);
|
||||||
|
Reference in New Issue
Block a user