mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
wip
This commit is contained in:
parent
bb6abe4e93
commit
0c7ff62d8d
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <openssl/md5.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/**
|
||||
* Define GPIO pins if not defined
|
||||
*/
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include "sls/sls_detector_funcs.h"
|
||||
#include "sls/string_utils.h"
|
||||
#include "sls/versionAPI.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
@ -21,6 +23,7 @@
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#include <openssl/md5.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
@ -3409,8 +3412,19 @@ sls_detector_module Module::readSettingsFile(const std::string &fname,
|
||||
return myMod;
|
||||
}
|
||||
|
||||
int Module::calculateChecksum(char *buffer, size_t bsize) {
|
||||
unsigned char checksum = 0;
|
||||
for(size_t i = 0; i != bsize; ++i)) {
|
||||
checksum ^= fgetc(fp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Module::programFPGAviaBlackfin(std::vector<char> buffer) {
|
||||
// calculate checksum
|
||||
uint64_t filesize = buffer.size();
|
||||
int checksum = calculateChecksum(&buffer[0], filesize);
|
||||
LOG(logINFOBLUE) << "checksum:" << checksum;
|
||||
// send program from memory to detector
|
||||
LOG(logINFO) << "Sending programming binary (from pof) to detector "
|
||||
<< moduleId << " (" << shm()->hostname << ")";
|
||||
|
@ -744,6 +744,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
std::string getTrimbitFilename(detectorSettings settings, int e_eV);
|
||||
sls_detector_module readSettingsFile(const std::string &fname,
|
||||
bool trimbits = true);
|
||||
int calculateChecksum(char *buffer, size_t bsize);
|
||||
void programFPGAviaBlackfin(std::vector<char> buffer);
|
||||
void programFPGAviaNios(std::vector<char> buffer);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user