Commit fb5cdbbd authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Clean up

parent 36b109ab
......@@ -36,18 +36,14 @@ FILENAME : ReadADC.c DESIGN REF: MC18
*/
#include <stdint.h>
//#include <stdio.h>
#include <limits.h>
#include <float.h>
#include <pru_cfg.h>
#include <pru_intc.h>
#include <pru_ctrl.h>
//#include <rsc_types.h>
#include <pru_rpmsg.h>
#include "resource_table_1.h"
#include <limits.h>
#include <float.h>
#include <time.h>
volatile register uint32_t __R31;
/* Host-1 Interrupt sets bit 31 in register R31 */
......@@ -77,15 +73,8 @@ volatile register uint32_t __R31;
#define HWREG(x) (*((volatile unsigned int *)(x)))
#define HWREGH(x) (*((volatile unsigned short *)(x)))
#define HWREGB(x) (*((volatile unsigned char *)(x)))
#define PRU1
#define benchmark1
#if 0
#ifndef PRU_SRAM
#define PRU_SRAM __far __attribute__((cregister("PRU_SHAREDMEM", near)))
#endif
#else
#endif
#define benchmark1
#pragma LOCATION(ScaleA0,0x0000)
#pragma LOCATION(ScaleA1,0x0004)
......@@ -127,21 +116,13 @@ struct pru2pru_data_transfer {
} p2pdt;
volatile float OCnorm, OCnorm_previous;
#if 0
#define MAX_SRAM_SAMPLES 1000
#else
#define MAX_SRAM_SAMPLES 100
#endif
struct pru2user_data_transfer {
float OCnorm;
unsigned int OVnorm;
unsigned int num5ns;
};
#if 0
PRU_SRAM struct pru2user_data_transfer p2udt[MAX_SRAM_SAMPLES];
#else
struct pru2user_data_transfer p2udt[MAX_SRAM_SAMPLES];
#endif
void SetSPI();
void SetADCBB();
......@@ -151,11 +132,14 @@ float mpy(float, float);
float sumf(float, float);
float mpy(float a, float b)
{return a*b;}
{
return a*b;
}
float sumf(float a, float b)
{return a+b;}
{
return a+b;
}
int main(void)
{
......@@ -188,7 +172,7 @@ int main(void)
OCnorm_previous = FLT_MAX;
ADC2_previous = UINT_MAX;
int HEAD_index = 0, TAIL_index = 0;
int HEAD_index = 0;
//init SPI
SetSPI();
......@@ -220,7 +204,6 @@ int main(void)
PRU1_CTRL.CTRL_bit.CTR_EN = 1;
PRU1_CTRL.CYCLE = 1;
//fill the buffer
for(i = 0; i < 32; i++)
{
......@@ -314,6 +297,7 @@ int main(void)
Debug2++; // Notification
if (pru_rpmsg_send(&transport, dst, src, &p2udt,
sizeof(struct pru2user_data_transfer) * 100) != PRU_RPMSG_SUCCESS) {
// FIXME Is it works? Or always return success?
Debug3++; // Notifications failed
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment