parent
1840f5bd41
commit
bce1707aa3
@ -1 +0,0 @@
|
||||
Subproject commit e4e246e8d86203c867227d6c8f8b6ab71def39ae
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,495 @@
|
||||
// Sends CubeSatSim telemetry encoded as CW (Morse Code) using AO-7 format
|
||||
//
|
||||
// Copyright (c) 2018 Alan Johnston
|
||||
//
|
||||
// Portions Copyright (c) 2018 Brandenburg Tech, LLC
|
||||
// All right reserved.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY BRANDENBURG TECH, LLC AND CONTRIBUTORS
|
||||
// ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRANDENBURT TECH, LLC
|
||||
// AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <axradio/axradioinit_p.h>
|
||||
#include <axradio/axradiomode_p.h>
|
||||
#include <axradio/axradiorx_p.h>
|
||||
#include <axradio/axradiotx_p.h>
|
||||
#include <generated/configtx.h>
|
||||
//#include <pthread.h>
|
||||
//#include <semaphore.h>
|
||||
#include <spi/ax5043spi_p.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <wiringPiI2C.h>
|
||||
#include <time.h>
|
||||
|
||||
#define MAX_MESSAGE_LENGTH (197)
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define VBATT 15
|
||||
#define ADC5 17
|
||||
#define ADC6 18
|
||||
#define ADC7 19
|
||||
#define ADC8 20
|
||||
#define TIME 8
|
||||
#define UCTEMP 30
|
||||
#define UPTIME_SEC 8
|
||||
#define A 1
|
||||
#define B 2
|
||||
#define C 3
|
||||
#define D 4
|
||||
|
||||
#define SENSOR_40 0
|
||||
#define SENSOR_41 3
|
||||
#define SENSOR_44 6
|
||||
#define SENSOR_45 9
|
||||
#define SENSOR_4A 12
|
||||
#define VOLTAGE 0
|
||||
#define CURRENT 1
|
||||
#define POWER 2
|
||||
|
||||
long int timestamp = 0;
|
||||
extern uint8_t axradio_rxbuffer[];
|
||||
void *transmit(void *arg);
|
||||
int get_message(uint8_t *buffer, int avail);
|
||||
int lower_digit(int number);
|
||||
int upper_digit(int number);
|
||||
int encode_digit(uint8_t *msg, int number);
|
||||
void config_cw();
|
||||
int encode_tlm(uint8_t *buffer, int channel, int val1, int val2, int val3, int val4, int avail);
|
||||
int encode_header(uint8_t *buffer, int avail);
|
||||
int add_dash(uint8_t *msg, int number);
|
||||
int add_dot(uint8_t *msg, int number);
|
||||
int add_space(uint8_t *msg);
|
||||
int get_tlm(int tlm[7][5]);
|
||||
int tempSensor, xPlusSensor, yPlusSensor, zPlusSensor, battCurrentSensor;
|
||||
extern int config_afsk();
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint8_t retVal;
|
||||
int tlm[7][5];
|
||||
int i, j;
|
||||
for (i = 1; i < 7; i++) {
|
||||
for (j = 1; j < 5; j++) {
|
||||
tlm[i][j] = 0;
|
||||
}
|
||||
}
|
||||
tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
|
||||
|
||||
// Configure SPI bus to AX5043
|
||||
setSpiChannel(SPI_CHANNEL);
|
||||
setSpiSpeed(SPI_SPEED);
|
||||
initializeSpi();
|
||||
// printf("1\n");
|
||||
|
||||
// if (send_cw_tlm) {
|
||||
// Send one frame of CW Telem
|
||||
// Initialize the AX5043
|
||||
retVal = axradio_init();
|
||||
if (retVal == AXRADIO_ERR_NOCHIP) {
|
||||
fprintf(stderr, "ERROR: No AX5043 RF chip found\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to initialize AX5043\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("INFO: Found and initialized AX5043\n");
|
||||
|
||||
retVal = mode_tx();
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to enter TX mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
config_cw();
|
||||
|
||||
// allocate space for the buffer
|
||||
static uint8_t packet[MAX_MESSAGE_LENGTH + 1];
|
||||
|
||||
int channel; // AO-7 telemetry format has 6 channels, 4 sub channels in each
|
||||
int msg_length;
|
||||
|
||||
while(1) { // loop infinitely
|
||||
for (channel = 0; channel < 7; channel++) {
|
||||
|
||||
get_tlm(tlm);
|
||||
if (channel == 0) {
|
||||
|
||||
// start with telemetry header "hi hi" plus a few chars to help CW decoding software sync
|
||||
msg_length = encode_header(&packet[0], MAX_MESSAGE_LENGTH + 1);
|
||||
|
||||
printf("\nINFO: Sending TLM header\n");
|
||||
|
||||
} else {
|
||||
|
||||
msg_length = encode_tlm(&packet[0], channel,
|
||||
tlm[channel][1], tlm[channel][2], tlm[channel][3], tlm[channel][4],
|
||||
(MAX_MESSAGE_LENGTH + 1));
|
||||
|
||||
printf("\nINFO: Sending TLM channel %d \n", channel);
|
||||
}
|
||||
retVal = transmit_packet(&remoteaddr_tx, packet, (uint16_t)(msg_length)); // send telemetry
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to transmit a packet\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
usleep(200000);
|
||||
}
|
||||
}
|
||||
// Encodes telemetry header (channel 0) into buffer
|
||||
//
|
||||
int encode_header(uint8_t *buffer, int avail) {
|
||||
|
||||
int count = 0;
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dash(&buffer[count], 1); // c
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_dash(&buffer[count], 1);
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dash(&buffer[count], 2); // q
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_dash(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 4); // h
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 2); // i
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 4); // h
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 2); // i
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
if (count > avail)
|
||||
printf("ERROR: encode_header count > avail \n");
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
// Encodes one channel of telemetry into buffer
|
||||
//
|
||||
int encode_tlm(uint8_t *buffer, int channel, int val1, int val2, int val3, int val4, int avail) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1aa
|
||||
count += encode_digit(&buffer[count], upper_digit(val1));
|
||||
count += encode_digit(&buffer[count], lower_digit(val1));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1bb
|
||||
count += encode_digit(&buffer[count], upper_digit(val2));
|
||||
count += encode_digit(&buffer[count], lower_digit(val2));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1cc
|
||||
count += encode_digit(&buffer[count], upper_digit(val3));
|
||||
count += encode_digit(&buffer[count], lower_digit(val3));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1dd
|
||||
count += encode_digit(&buffer[count], upper_digit(val4));
|
||||
count += encode_digit(&buffer[count], lower_digit(val4));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
//printf("DEBUG count: %d avail: %d \n", count, avail);
|
||||
if (count > avail) { // make sure not too long
|
||||
buffer[avail-1] = 0;
|
||||
count = avail-1;
|
||||
printf("DEBUG count > avail!\n");
|
||||
}
|
||||
return count;
|
||||
}
|
||||
// Encodes a single digit of telemetry into buffer
|
||||
//
|
||||
int encode_digit(uint8_t *buffer, int digit) {
|
||||
int count = 0;
|
||||
switch(digit)
|
||||
{
|
||||
case 0:
|
||||
count += add_dash(&buffer[count], 5); // 0
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 1:
|
||||
count += add_dot(&buffer[count], 1); // 1
|
||||
count += add_dash(&buffer[count], 4);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
count += add_dot(&buffer[count], 2); // 2
|
||||
count += add_dash(&buffer[count], 3);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
count += add_dot(&buffer[count], 3); // 3
|
||||
count += add_dash(&buffer[count], 2);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 4:
|
||||
count += add_dot(&buffer[count], 4); // 4
|
||||
count += add_dash(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 5:
|
||||
count += add_dot(&buffer[count], 5); // 5
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 6:
|
||||
count += add_dash(&buffer[count], 1); // 6
|
||||
count += add_dot(&buffer[count], 4);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 7:
|
||||
|
||||
count += add_dash(&buffer[count], 2); // 7
|
||||
count += add_dot(&buffer[count], 3);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 8:
|
||||
count += add_dash(&buffer[count], 3); // 8
|
||||
count += add_dot(&buffer[count], 2);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 9:
|
||||
count += add_dash(&buffer[count], 4); // 9
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
default:
|
||||
printf("ERROR: Not a digit!\n");
|
||||
return 0;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
// Returns lower digit of a number which must be less than 99
|
||||
//
|
||||
int lower_digit(int number) {
|
||||
|
||||
int digit = 0;
|
||||
if (number < 100)
|
||||
digit = number - ((int)(number/10) * 10);
|
||||
else
|
||||
printf("ERROR: Not a digit in lower_digit!\n");
|
||||
return digit;
|
||||
}
|
||||
// Returns upper digit of a number which must be less than 99
|
||||
//
|
||||
int upper_digit(int number) {
|
||||
|
||||
int digit = 0;
|
||||
if (number < 100)
|
||||
digit = (int)(number/10);
|
||||
else
|
||||
printf("ERROR: Not a digit in upper_digit!\n");
|
||||
return digit;
|
||||
}
|
||||
// Configure radio to send CW which is ASK
|
||||
//
|
||||
void config_cw() {
|
||||
|
||||
uint8_t retVal;
|
||||
|
||||
// Configure SPI bus to AX5043
|
||||
// setSpiChannel(SPI_CHANNEL);
|
||||
// setSpiSpeed(SPI_SPEED);
|
||||
// initializeSpi();
|
||||
// printf("1\n");
|
||||
|
||||
// Initialize the AX5043
|
||||
retVal = axradio_init();
|
||||
// printf("2\n");
|
||||
if (retVal == AXRADIO_ERR_NOCHIP) {
|
||||
fprintf(stderr, "ERROR: No AX5043 RF chip found\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to initialize AX5043\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// printf("INFO: Found and initialized AX5043\n");
|
||||
|
||||
retVal = mode_tx();
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to enter TX mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// printf("Register write to clear framing and crc\n");
|
||||
ax5043WriteReg(0x12,0);
|
||||
|
||||
// printf("Register write to disable fec\n");
|
||||
ax5043WriteReg(0x18,0);
|
||||
|
||||
// printf("Register write \n");
|
||||
ax5043WriteReg(0x165,0);
|
||||
|
||||
ax5043WriteReg(0x166,0);
|
||||
ax5043WriteReg(0x167,0x50); // 0x25); // 0x50); // 0x08); // 0x20);
|
||||
|
||||
ax5043WriteReg(0x161,0);
|
||||
ax5043WriteReg(0x162,0x20);
|
||||
|
||||
// long txRate;
|
||||
// txRate = ax5043ReadReg(0x167) + 256 * ax5043ReadReg(0x166) + 65536 * ax5043ReadReg(0x165);
|
||||
// printf("Tx Rate %x %x %x \n", ax5043ReadReg(0x165), ax5043ReadReg(0x166), ax5043ReadReg(0x167));
|
||||
// long fskDev;
|
||||
// fskDev = ax5043ReadReg(0x163) + 256 * ax5043ReadReg(0x162) + 65536 * ax5043ReadReg(0x161);
|
||||
|
||||
ax5043WriteReg(0x37,(uint8_t)((ax5043ReadReg(0x37) + 4))); // Increase FREQA
|
||||
|
||||
// printf("Tx Rate: %ld FSK Dev: %ld \n", txRate, fskDev);
|
||||
|
||||
ax5043WriteReg(0x10,0); // ASK
|
||||
|
||||
// printf("Modulation: %x \n", (int)ax5043ReadReg(0x10));
|
||||
// printf("Frequency A: 0x%x %x %x %x \n",(int)ax5043ReadReg(0x34),(int)ax5043ReadReg(0x35),(int)ax5043ReadReg(0x36),(int)ax5043ReadReg(0x37));
|
||||
|
||||
/*
|
||||
int x;
|
||||
for (x = 0; x < 0x20; x++)
|
||||
{
|
||||
printf("Register %x contents: %x\n",x,(int)ax5043ReadReg(x));
|
||||
}
|
||||
|
||||
printf("Register Dump complete");
|
||||
*/
|
||||
return;
|
||||
}
|
||||
// Adds a Morse space to the buffer
|
||||
//
|
||||
int add_space(uint8_t *msg) {
|
||||
msg[0] = 0x00; // a space is 8 bits
|
||||
return 1;
|
||||
}
|
||||
// Adds a Morse dash to the buffer
|
||||
//
|
||||
int add_dash(uint8_t *msg, int number) {
|
||||
int j;
|
||||
int counter = 0;
|
||||
|
||||
for (j=0; j < number; j++) { // a dot is 4 bits, so a dash is 12 bits
|
||||
msg[counter++] = 0xff;
|
||||
msg[counter++] = 0x0f;
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
// Adds a Morse dot to the buffer
|
||||
//
|
||||
int add_dot(uint8_t *msg, int number) {
|
||||
int counter = 0;
|
||||
int j;
|
||||
for (j=0; j < number; j++) { // a dot is 4 bits
|
||||
msg[counter++] = 0x0f;
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
int get_tlm(int tlm[][5]) {
|
||||
|
||||
// Reading I2C voltage and current sensors
|
||||
|
||||
char cmdbuffer[1000];
|
||||
FILE* file = popen("sudo python /home/pi/CubeSatSim/python/readcurrent.py 2>&1", "r");
|
||||
fgets(cmdbuffer, 1000, file);
|
||||
pclose(file);
|
||||
printf("I2C Sensor data: %s\n", cmdbuffer);
|
||||
|
||||
char ina219[16][20]; // voltage, currents, and power from the INA219 current sensors x4a, x40, x41, x44, and x45.
|
||||
int i = 0;
|
||||
char * data2 = strtok (cmdbuffer," ");
|
||||
|
||||
while (data2 != NULL) {
|
||||
strcpy(ina219[i], data2);
|
||||
// printf ("ina219[%d]=%s\n",i,ina219[i]);
|
||||
data2 = strtok (NULL, " ");
|
||||
i++;
|
||||
}
|
||||
// printf("1B: ina219[%d]: %s val: %f \n", SENSOR_40 + CURRENT, ina219[SENSOR_40 + CURRENT], strtof(ina219[SENSOR_40 + CURRENT], NULL));
|
||||
|
||||
tlm[1][A] = (int)(strtof(ina219[SENSOR_4A + CURRENT], NULL) / 15 + 0.5); // Current of 5V supply to Pi
|
||||
tlm[1][B] = (int) (99.5 - strtof(ina219[SENSOR_40 + CURRENT], NULL)/10); // +X current [4]
|
||||
tlm[1][D] = (int) (99.5 - strtof(ina219[SENSOR_41 + CURRENT], NULL)/10); // +Y current [7]
|
||||
tlm[1][C] = (int) (99.5 - strtof(ina219[SENSOR_44 + CURRENT], NULL)/10); // +Z current [10] (actually -X current, AO-7 didn't have a Z solar panel?)
|
||||
|
||||
tlm[2][B] = 99;
|
||||
tlm[2][C] = (int)((time(NULL) - timestamp) / 15) % 100;
|
||||
tlm[2][D] = (int)(50.5 + strtof(ina219[SENSOR_45 + CURRENT], NULL)/10.0); // NiMH Battery current
|
||||
|
||||
tlm[3][A] = (int)((strtof(ina219[SENSOR_45 + VOLTAGE], NULL) * 10) - 65.5);
|
||||
tlm[3][B] = (int)(strtof(ina219[SENSOR_4A + VOLTAGE], NULL) * 10.0); // 5V supply to Pi
|
||||
|
||||
int tempValue = wiringPiI2CReadReg16(tempSensor, 0);
|
||||
// printf("Read: %x\n", tempValue);
|
||||
uint8_t upper = (uint8_t) (tempValue >> 8);
|
||||
uint8_t lower = (uint8_t) (tempValue & 0xff);
|
||||
float temp = (float)lower + ((float)upper / 0x100);
|
||||
|
||||
tlm[4][A] = (int)((95.8 - temp)/1.48 + 0.5);
|
||||
|
||||
tlm[6][B] = 0 ;
|
||||
tlm[6][D] = 49 + rand() % 3;
|
||||
|
||||
// Display tlm
|
||||
int k, j;
|
||||
for (k = 1; k < 7; k++) {
|
||||
for (j = 1; j < 5; j++) {
|
||||
printf(" %2d ", tlm[k][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,498 @@
|
||||
// Sends CubeSatSim telemetry encoded as CW (Morse Code) using AO-7 format
|
||||
//
|
||||
// Copyright (c) 2018 Alan Johnston
|
||||
//
|
||||
// Portions Copyright (c) 2018 Brandenburg Tech, LLC
|
||||
// All right reserved.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY BRANDENBURG TECH, LLC AND CONTRIBUTORS
|
||||
// ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRANDENBURT TECH, LLC
|
||||
// AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <axradio/axradioinit_p.h>
|
||||
#include <axradio/axradiomode_p.h>
|
||||
#include <axradio/axradiorx_p.h>
|
||||
#include <axradio/axradiotx_p.h>
|
||||
#include <generated/configtx.h>
|
||||
//#include <pthread.h>
|
||||
//#include <semaphore.h>
|
||||
#include <spi/ax5043spi_p.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <wiringPiI2C.h>
|
||||
#include <time.h>
|
||||
|
||||
#define MAX_MESSAGE_LENGTH (197)
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define VBATT 15
|
||||
#define ADC5 17
|
||||
#define ADC6 18
|
||||
#define ADC7 19
|
||||
#define ADC8 20
|
||||
#define TIME 8
|
||||
#define UCTEMP 30
|
||||
#define UPTIME_SEC 8
|
||||
#define A 1
|
||||
#define B 2
|
||||
#define C 3
|
||||
#define D 4
|
||||
|
||||
#define SENSOR_40 0
|
||||
#define SENSOR_41 3
|
||||
#define SENSOR_44 6
|
||||
#define SENSOR_45 9
|
||||
#define SENSOR_4A 12
|
||||
#define VOLTAGE 0
|
||||
#define CURRENT 1
|
||||
#define POWER 2
|
||||
|
||||
long int timestamp = 0;
|
||||
extern uint8_t axradio_rxbuffer[];
|
||||
void *transmit(void *arg);
|
||||
int get_message(uint8_t *buffer, int avail);
|
||||
int lower_digit(int number);
|
||||
int upper_digit(int number);
|
||||
int encode_digit(uint8_t *msg, int number);
|
||||
void config_cw();
|
||||
int encode_tlm(uint8_t *buffer, int channel, int val1, int val2, int val3, int val4, int avail);
|
||||
int encode_header(uint8_t *buffer, int avail);
|
||||
int add_dash(uint8_t *msg, int number);
|
||||
int add_dot(uint8_t *msg, int number);
|
||||
int add_space(uint8_t *msg);
|
||||
int get_tlm(int tlm[7][5]);
|
||||
int tempSensor, xPlusSensor, yPlusSensor, zPlusSensor, battCurrentSensor;
|
||||
extern int config_afsk();
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint8_t retVal;
|
||||
int tlm[7][5];
|
||||
int i, j;
|
||||
for (i = 1; i < 7; i++) {
|
||||
for (j = 1; j < 5; j++) {
|
||||
tlm[i][j] = 0;
|
||||
}
|
||||
}
|
||||
tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
|
||||
|
||||
// Configure SPI bus to AX5043
|
||||
setSpiChannel(SPI_CHANNEL);
|
||||
setSpiSpeed(SPI_SPEED);
|
||||
initializeSpi();
|
||||
// printf("1\n");
|
||||
|
||||
// if (send_cw_tlm) {
|
||||
// Send one frame of CW Telem
|
||||
// Initialize the AX5043
|
||||
retVal = axradio_init();
|
||||
if (retVal == AXRADIO_ERR_NOCHIP) {
|
||||
fprintf(stderr, "ERROR: No AX5043 RF chip found\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to initialize AX5043\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("INFO: Found and initialized AX5043\n");
|
||||
|
||||
retVal = mode_tx();
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to enter TX mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
config_cw();
|
||||
|
||||
// allocate space for the buffer
|
||||
static uint8_t packet[MAX_MESSAGE_LENGTH + 1];
|
||||
|
||||
int channel; // AO-7 telemetry format has 6 channels, 4 sub channels in each
|
||||
int msg_length;
|
||||
|
||||
while(1) { // loop infinitely
|
||||
for (channel = 0; channel < 7; channel++) {
|
||||
|
||||
get_tlm(tlm);
|
||||
if (channel == 0) {
|
||||
|
||||
// start with telemetry header "hi hi" plus a few chars to help CW decoding software sync
|
||||
msg_length = encode_header(&packet[0], MAX_MESSAGE_LENGTH + 1);
|
||||
|
||||
printf("\nINFO: Sending TLM header\n");
|
||||
|
||||
} else {
|
||||
|
||||
msg_length = encode_tlm(&packet[0], channel,
|
||||
tlm[channel][1], tlm[channel][2], tlm[channel][3], tlm[channel][4],
|
||||
(MAX_MESSAGE_LENGTH + 1));
|
||||
|
||||
printf("\nINFO: Sending TLM channel %d \n", channel);
|
||||
}
|
||||
retVal = transmit_packet(&remoteaddr_tx, packet, (uint16_t)(msg_length)); // send telemetry
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to transmit a packet\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
usleep(200000);
|
||||
}
|
||||
}
|
||||
// Encodes telemetry header (channel 0) into buffer
|
||||
//
|
||||
int encode_header(uint8_t *buffer, int avail) {
|
||||
|
||||
int count = 0;
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dash(&buffer[count], 1); // c
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_dash(&buffer[count], 1);
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dash(&buffer[count], 2); // q
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_dash(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 4); // h
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 2); // i
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 4); // h
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_dot(&buffer[count], 2); // i
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
if (count > avail)
|
||||
printf("ERROR: encode_header count > avail \n");
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
// Encodes one channel of telemetry into buffer
|
||||
//
|
||||
int encode_tlm(uint8_t *buffer, int channel, int val1, int val2, int val3, int val4, int avail) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1aa
|
||||
count += encode_digit(&buffer[count], upper_digit(val1));
|
||||
count += encode_digit(&buffer[count], lower_digit(val1));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1bb
|
||||
count += encode_digit(&buffer[count], upper_digit(val2));
|
||||
count += encode_digit(&buffer[count], lower_digit(val2));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1cc
|
||||
count += encode_digit(&buffer[count], upper_digit(val3));
|
||||
count += encode_digit(&buffer[count], lower_digit(val3));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
count += encode_digit(&buffer[count], channel); // for channel 1, encodes 1dd
|
||||
count += encode_digit(&buffer[count], upper_digit(val4));
|
||||
count += encode_digit(&buffer[count], lower_digit(val4));
|
||||
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
//printf("DEBUG count: %d avail: %d \n", count, avail);
|
||||
if (count > avail) { // make sure not too long
|
||||
buffer[avail-1] = 0;
|
||||
count = avail-1;
|
||||
printf("DEBUG count > avail!\n");
|
||||
}
|
||||
return count;
|
||||
}
|
||||
// Encodes a single digit of telemetry into buffer
|
||||
//
|
||||
int encode_digit(uint8_t *buffer, int digit) {
|
||||
int count = 0;
|
||||
switch(digit)
|
||||
{
|
||||
case 0:
|
||||
count += add_dash(&buffer[count], 5); // 0
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 1:
|
||||
count += add_dot(&buffer[count], 1); // 1
|
||||
count += add_dash(&buffer[count], 4);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
count += add_dot(&buffer[count], 2); // 2
|
||||
count += add_dash(&buffer[count], 3);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
count += add_dot(&buffer[count], 3); // 3
|
||||
count += add_dash(&buffer[count], 2);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 4:
|
||||
count += add_dot(&buffer[count], 4); // 4
|
||||
count += add_dash(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 5:
|
||||
count += add_dot(&buffer[count], 5); // 5
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 6:
|
||||
count += add_dash(&buffer[count], 1); // 6
|
||||
count += add_dot(&buffer[count], 4);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 7:
|
||||
|
||||
count += add_dash(&buffer[count], 2); // 7
|
||||
count += add_dot(&buffer[count], 3);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 8:
|
||||
count += add_dash(&buffer[count], 3); // 8
|
||||
count += add_dot(&buffer[count], 2);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
case 9:
|
||||
count += add_dash(&buffer[count], 4); // 9
|
||||
count += add_dot(&buffer[count], 1);
|
||||
count += add_space(&buffer[count]);
|
||||
|
||||
break;
|
||||
default:
|
||||
printf("ERROR: Not a digit!\n");
|
||||
return 0;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
// Returns lower digit of a number which must be less than 99
|
||||
//
|
||||
int lower_digit(int number) {
|
||||
|
||||
int digit = 0;
|
||||
if (number < 100)
|
||||
digit = number - ((int)(number/10) * 10);
|
||||
else
|
||||
printf("ERROR: Not a digit in lower_digit!\n");
|
||||
return digit;
|
||||
}
|
||||
// Returns upper digit of a number which must be less than 99
|
||||
//
|
||||
int upper_digit(int number) {
|
||||
|
||||
int digit = 0;
|
||||
if (number < 100)
|
||||
digit = (int)(number/10);
|
||||
else
|
||||
printf("ERROR: Not a digit in upper_digit!\n");
|
||||
return digit;
|
||||
}
|
||||
// Configure radio to send CW which is ASK
|
||||
//
|
||||
void config_cw() {
|
||||
|
||||
uint8_t retVal;
|
||||
|
||||
// Configure SPI bus to AX5043
|
||||
// setSpiChannel(SPI_CHANNEL);
|
||||
// setSpiSpeed(SPI_SPEED);
|
||||
// initializeSpi();
|
||||
// printf("1\n");
|
||||
|
||||
// Initialize the AX5043
|
||||
retVal = axradio_init();
|
||||
// printf("2\n");
|
||||
if (retVal == AXRADIO_ERR_NOCHIP) {
|
||||
fprintf(stderr, "ERROR: No AX5043 RF chip found\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to initialize AX5043\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// printf("INFO: Found and initialized AX5043\n");
|
||||
|
||||
retVal = mode_tx();
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to enter TX mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// printf("Register write to clear framing and crc\n");
|
||||
ax5043WriteReg(0x12,0);
|
||||
|
||||
// printf("Register write to disable fec\n");
|
||||
ax5043WriteReg(0x18,0);
|
||||
|
||||
// printf("Register write \n");
|
||||
ax5043WriteReg(0x165,0);
|
||||
|
||||
ax5043WriteReg(0x166,0);
|
||||
ax5043WriteReg(0x167,0x50); // 0x25); // 0x50); // 0x08); // 0x20);
|
||||
|
||||
ax5043WriteReg(0x161,0);
|
||||
ax5043WriteReg(0x162,0x20);
|
||||
|
||||
// long txRate;
|
||||
// txRate = ax5043ReadReg(0x167) + 256 * ax5043ReadReg(0x166) + 65536 * ax5043ReadReg(0x165);
|
||||
// printf("Tx Rate %x %x %x \n", ax5043ReadReg(0x165), ax5043ReadReg(0x166), ax5043ReadReg(0x167));
|
||||
// long fskDev;
|
||||
// fskDev = ax5043ReadReg(0x163) + 256 * ax5043ReadReg(0x162) + 65536 * ax5043ReadReg(0x161);
|
||||
|
||||
ax5043WriteReg(0x37,(uint8_t)((ax5043ReadReg(0x37) + 4))); // Increase FREQA
|
||||
|
||||
// printf("Tx Rate: %ld FSK Dev: %ld \n", txRate, fskDev);
|
||||
|
||||
ax5043WriteReg(0x10,0); // ASK
|
||||
|
||||
// printf("Modulation: %x \n", (int)ax5043ReadReg(0x10));
|
||||
// printf("Frequency A: 0x%x %x %x %x \n",(int)ax5043ReadReg(0x34),(int)ax5043ReadReg(0x35),(int)ax5043ReadReg(0x36),(int)ax5043ReadReg(0x37));
|
||||
|
||||
/*
|
||||
int x;
|
||||
for (x = 0; x < 0x20; x++)
|
||||
{
|
||||
printf("Register %x contents: %x\n",x,(int)ax5043ReadReg(x));
|
||||
}
|
||||
|
||||
printf("Register Dump complete");
|
||||
*/
|
||||
return;
|
||||
}
|
||||
// Adds a Morse space to the buffer
|
||||
//
|
||||
int add_space(uint8_t *msg) {
|
||||
msg[0] = 0x00; // a space is 8 bits
|
||||
return 1;
|
||||
}
|
||||
// Adds a Morse dash to the buffer
|
||||
//
|
||||
int add_dash(uint8_t *msg, int number) {
|
||||
int j;
|
||||
int counter = 0;
|
||||
|
||||
for (j=0; j < number; j++) { // a dot is 4 bits, so a dash is 12 bits
|
||||
msg[counter++] = 0xff;
|
||||
msg[counter++] = 0x0f;
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
// Adds a Morse dot to the buffer
|
||||
//
|
||||
int add_dot(uint8_t *msg, int number) {
|
||||
int counter = 0;
|
||||
int j;
|
||||
for (j=0; j < number; j++) { // a dot is 4 bits
|
||||
msg[counter++] = 0x0f;
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
int get_tlm(int tlm[][5]) {
|
||||
|
||||
// Reading I2C voltage and current sensors
|
||||
|
||||
char cmdbuffer[1000];
|
||||
FILE* file = popen("sudo python /home/pi/CubeSatSim/python/readcurrent.py 2>&1", "r");
|
||||
fgets(cmdbuffer, 1000, file);
|
||||
pclose(file);
|
||||
printf("I2C Sensor data: %s\n", cmdbuffer);
|
||||
|
||||
char ina219[16][20]; // voltage, currents, and power from the INA219 current sensors x4a, x40, x41, x44, and x45.
|
||||
int i = 0;
|
||||
char * data2 = strtok (cmdbuffer," ");
|
||||
|
||||
while (data2 != NULL) {
|
||||
strcpy(ina219[i], data2);
|
||||
// printf ("ina219[%d]=%s\n",i,ina219[i]);
|
||||
data2 = strtok (NULL, " ");
|
||||
i++;
|
||||
}
|
||||
// printf("1B: ina219[%d]: %s val: %f \n", SENSOR_40 + CURRENT, ina219[SENSOR_40 + CURRENT], strtof(ina219[SENSOR_40 + CURRENT], NULL));
|
||||
|
||||
tlm[1][A] = (int)(strtof(ina219[SENSOR_4A + CURRENT], NULL) / 15 + 0.5); // Current of 5V supply to Pi
|
||||
tlm[1][B] = (int) (99.5 - strtof(ina219[SENSOR_40 + CURRENT], NULL)/10); // +X current [4]
|
||||
tlm[1][D] = (int) (99.5 - strtof(ina219[SENSOR_41 + CURRENT], NULL)/10); // +Y current [7]
|
||||
tlm[1][C] = (int) (99.5 - strtof(ina219[SENSOR_44 + CURRENT], NULL)/10); // +Z current [10] (actually -X current, AO-7 didn't have a Z solar panel?)
|
||||
|
||||
tlm[2][B] = 99;
|
||||
tlm[2][C] = (int)((time(NULL) - timestamp) / 15) % 100;
|
||||
tlm[2][D] = (int)(50.5 + strtof(ina219[SENSOR_45 + CURRENT], NULL)/10.0); // NiMH Battery current
|
||||
|
||||
tlm[3][A] = (int)((strtof(ina219[SENSOR_45 + VOLTAGE], NULL) * 10) - 65.5);
|
||||
tlm[3][B] = (int)(strtof(ina219[SENSOR_4A + VOLTAGE], NULL) * 10.0); // 5V supply to Pi
|
||||
|
||||
int tempValue = wiringPiI2CReadReg16(tempSensor, 0);
|
||||
// printf("Read: %x\n", tempValue);
|
||||
uint8_t upper = (uint8_t) (tempValue >> 8);
|
||||
uint8_t lower = (uint8_t) (tempValue & 0xff);
|
||||
float temp = (float)lower + ((float)upper / 0x100);
|
||||
|
||||
tlm[4][A] = (int)((95.8 - temp)/1.48 + 0.5);
|
||||
|
||||
tlm[6][B] = 0 ;
|
||||
tlm[6][D] = 49 + rand() % 3;
|
||||
|
||||
// Display tlm
|
||||
int k, j;
|
||||
for (k = 1; k < 7; k++) {
|
||||
for (j = 1; j < 5; j++) {
|
||||
printf(" %2d ", tlm[k][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1981221934" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1619929842" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
|
||||
<builder buildPath="${workspace_loc:/receive}/Debug" id="cdt.managedbuild.tool.gnu.builder.mingw.base.273401127" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.790972888" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.2105178793" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1407480085" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.845034471" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
|
||||
<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1040270702" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1010053083" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.510479808" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.124218310" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.1262509931" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.1655697172" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ax5043}""/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.warnings.extrawarn.997238960" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.warnings.pedantic.1492719739" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.warnings.wconversion.89503981" superClass="gnu.c.compiler.option.warnings.wconversion" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1824426539" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1287518147" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
|
||||
<option id="gnu.c.link.option.libs.1110857036" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="ax5043"/>
|
||||
</option>
|
||||
<option id="gnu.c.link.option.paths.852158887" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ax5043/Debug}""/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1321828044" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.160933069" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.release.2031114536">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.release.2031114536" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.release.2031114536" name="Release" parent="cdt.managedbuild.config.gnu.mingw.exe.release">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.release.2031114536." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.release.477588430" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.release">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.release.502490511" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.release"/>
|
||||
<builder buildPath="${workspace_loc:/receive}/Release" id="cdt.managedbuild.tool.gnu.builder.mingw.base.2049629890" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release.1627838911" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1934132045" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1436846341" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.2076891159" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release">
|
||||
<option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.539023113" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.1837173580" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1419624147" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release">
|
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.1437091261" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.2083280222" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.826572240" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.94160235" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1624123178" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1369250166" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="receive.cdt.managedbuild.target.gnu.mingw.exe.2006190581" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818;cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.510479808;cdt.managedbuild.tool.gnu.c.compiler.input.1824426539">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.2031114536;cdt.managedbuild.config.gnu.mingw.exe.release.2031114536.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1419624147;cdt.managedbuild.tool.gnu.c.compiler.input.826572240">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
</cproject>
|
||||
@ -1 +0,0 @@
|
||||
/Debug/
|
||||
@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>receive</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
<configuration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818" name="Debug">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="1896922210155201054" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
<configuration id="cdt.managedbuild.config.gnu.mingw.exe.release.2031114536" name="Release">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="1896922210155201054" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
</project>
|
||||
@ -1,11 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/CPATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/CPATH/operation=remove
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/C_INCLUDE_PATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/C_INCLUDE_PATH/operation=remove
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/append=true
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/appendContributed=true
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/LIBRARY_PATH/delimiter=;
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/LIBRARY_PATH/operation=remove
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/append=true
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1428445818/appendContributed=true
|
||||
@ -1,104 +0,0 @@
|
||||
// Copyright (c) 2018 Brandenburg Tech, LLC
|
||||
// All right reserved.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY BRANDENBURG TECH, LLC AND CONTRIBUTORS
|
||||
// ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRANDENBURT TECH, LLC
|
||||
// AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2007,2008,2009,2010,2011,2012,2013, 2014 AXSEM AG
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1.Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// 2.Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
// 3.Neither the name of AXSEM AG, Duebendorf nor the
|
||||
// names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
// 4.All advertising materials mentioning features or use of this software
|
||||
// must display the following acknowledgement:
|
||||
// This product includes software developed by AXSEM AG and its contributors.
|
||||
// 5.The usage of this source code is only granted for operation with AX5043
|
||||
// and AX8052F143. Porting to other radio or communication devices is
|
||||
// strictly prohibited.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY AXSEM AG AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL AXSEM AG AND CONTRIBUTORS BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <axradio/axradioinit_p.h>
|
||||
#include <axradio/axradiomode_p.h>
|
||||
#include <axradio/axradiorx_p.h>
|
||||
#include <spi/ax5043spi_p.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern uint8_t axradio_rxbuffer[];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint8_t retVal;
|
||||
|
||||
setSpiChannel(SPI_CHANNEL);
|
||||
setSpiSpeed(SPI_SPEED);
|
||||
initializeSpi();
|
||||
|
||||
retVal = axradio_init();
|
||||
if (retVal == AXRADIO_ERR_NOCHIP) {
|
||||
fprintf(stderr, "ERROR: No AX5043 RF chip found\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to initialize AX5043\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("INFO: Found and initialized AX5043\n");
|
||||
|
||||
retVal = mode_rx();
|
||||
if (retVal != AXRADIO_ERR_NOERROR) {
|
||||
fprintf(stderr, "ERROR: Unable to enter RX mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
retVal = receive_packet();
|
||||
if (retVal > 0) {
|
||||
uint8_t counter = 0;
|
||||
while (retVal-- > 0) {
|
||||
if (counter > 0 && counter % 16 == 0) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("%02x ", axradio_rxbuffer[counter++]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
|
||||
usleep(1000000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue