Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
sample and error counts added to txt file #1
Browse files Browse the repository at this point in the history
  • Loading branch information
alux committed Jun 24, 2021
1 parent 3b80cc6 commit ac0bfe6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ env.sh
doc/html
bin
*.DS_Store
python/test.png
python/test.txt
2 changes: 2 additions & 0 deletions include/ApolloSM/eyescan.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ struct eyescanCoords {
int voltage;
double phase;
double BER;
int sample;
int errors;
uint8_t voltageReg;
uint16_t phaseReg;
};
Expand Down
7 changes: 4 additions & 3 deletions src/ApolloSM/ApolloSM_eyescan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,11 @@ std::vector<eyescanCoords> ApolloSM::EyeScan(std::string baseNode, std::string l
esCoords[coordsIndex].voltage = voltage;
esCoords[coordsIndex].phase = phase;
// printf("%d %d\n", voltage, phaseInt);

printf("Start pixel scan\n");
//Get BER for this point
esCoords[coordsIndex].BER = SingleEyeScan(baseNode, lpmNode, maxPrescale);
printf("Pixel scan done\n");
//sample count and error count for this point
esCoords[coordsIndex].sample = RegReadRegister(baseNode + "SAMPLE_COUNT");
esCoords[coordsIndex].error = RegReadRegister(baseNode + "ERROR_COUNT");
// Vert sign mask is 0x80 so we need to shift right by 7
esCoords[coordsIndex].voltageReg = RegReadRegister(baseNode + "VERT_OFFSET_MAG") | (RegReadRegister(baseNode + "VERT_OFFSET_SIGN") << 7);
esCoords[coordsIndex].phaseReg = RegReadRegister(baseNode + "HORZ_OFFSET_MAG")&0x0FFF;
Expand Down
2 changes: 2 additions & 0 deletions src/ApolloSM_device/ApolloSM_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ CommandReturn::status ApolloSMDevice::EyeScan(std::vector<std::string> strArg, s
fprintf(dataFile, "%.9f ", esCoords[i].phase);
fprintf(dataFile, "%d ", esCoords[i].voltage);
fprintf(dataFile, "%f ", esCoords[i].BER);
fprintf(dataFile, "%d ", esCoords[i].sample);
fprintf(dataFile, "%d ", esCoords[i].error);
fprintf(dataFile, "%x ", esCoords[i].voltageReg & 0xFF);
fprintf(dataFile, "%x\n", esCoords[i].phaseReg & 0xFFF);
}
Expand Down

0 comments on commit ac0bfe6

Please sign in to comment.