First of all I have to mention that I am still using the very first Ecosystem. (I don't know if that's relevant at all for the nginx server I address here).
I used to edit the standard oscilloscope app to accomodate that to my needs. Up to now it worked very fine for me but now I need 4 signal channels instead of the default 2.
I do know how to adapt my Firmware to get memory for four channels but then I fail when the data is transferred via nginx.
Obviously it's not sufficient to update the rp_osc_get_signal() in main.c
(Beside all relevant initialisations of the rp_osc_signal) I just extended the aforementioned function to this:
Code: Select all
/*----------------------------------------------------------------------------------*/
int rp_osc_get_signals(float ***signals, int *sig_idx)
{
float **s = *signals;
pthread_mutex_lock(&rp_osc_sig_mutex);
if(rp_osc_signals_dirty == 0) {
*sig_idx = rp_osc_sig_last_idx;
pthread_mutex_unlock(&rp_osc_sig_mutex);
return -1;
}
memcpy(&s[0][0], &rp_osc_signals[0][0], sizeof(float)*SIGNAL_LENGTH);
memcpy(&s[1][0], &rp_osc_signals[1][0], sizeof(float)*SIGNAL_LENGTH);
memcpy(&s[2][0], &rp_osc_signals[2][0], sizeof(float)*SIGNAL_LENGTH);
memcpy(&s[3][0], &rp_osc_signals[3][0], sizeof(float)*SIGNAL_LENGTH);
*sig_idx = rp_osc_sig_last_idx;
rp_osc_signals_dirty = 0;
pthread_mutex_unlock(&rp_osc_sig_mutex);
return 0;
}
What is it that I forget here?
Hope you guys can help. And thanx in advance.
Georg