Skip to content

Commit dd02895

Browse files
author
Peter Wegmann
committed
remote Pulse messages are now limited to 25 datapoints per packet and a maximum of 5 packets
1 parent 6f16cdd commit dd02895

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

Controller/pulse_select_mode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ void pulse_select_drawPage(void){
635635
activeOpt--;
636636
OptarrIndex = PageNr * 5;
637637

638+
// small coordinate system top right corner
638639
switch(PageNr){
639640
case 0:
640641
pulseSelect_paintNormal(PLOT_X-XOFFSET_32+xoff,PLOT_Y);
@@ -646,7 +647,7 @@ void pulse_select_drawPage(void){
646647
pulseSelect_paintLinear(PLOT_X-XOFFSET_32+xoff,PLOT_Y);
647648
break;
648649
}
649-
650+
650651
for (uint8_t i = 0; i < 5; i++ )
651652
{
652653
if (activeOpt == i && pselect_model.value == 0)
@@ -669,6 +670,7 @@ void pulse_select_drawPage(void){
669670
}
670671

671672
}
673+
672674

673675
}
674676

StringPixelCoordTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@
323323

324324

325325
//diag_pulse()
326-
#define DP_NUMBER_OF_POINTS_140 140
326+
#define DP_NUMBER_OF_POINTS_140 125
327327
#define DP_POINTS_IN_PULSE_80 80
328328
#define DP_U_ZEROLINE_70 70
329329
#define DP_I_ZEROLINE_125 125

diag_pulse.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
// 3. incrementally increasing current delta I each delta t
2727

2828
double heattime_linear;
29+
uint8_t diag_send_buffer[SINGLE_FRAME_LENGTH];
2930

3031

3132
void diag_pulse_init(diag_pulseType* dp, _Bool headless, uint8_t pulse_type){
@@ -762,7 +763,7 @@ void diag_pulse_move_cursor(diag_pulseType *dp,int8_t direction){
762763

763764

764765
void diag_pulse_send(diag_pulseType *dp){
765-
uint8_t diag_send_buffer[SINGLE_FRAME_LENGTH];
766+
766767

767768

768769

@@ -795,7 +796,7 @@ void diag_pulse_send(diag_pulseType *dp){
795796
diag_send_buffer[5] = Time.tm_year;
796797

797798
//TODO
798-
uint8_t Datatpoints_per_Packet = 30;
799+
uint8_t Datatpoints_per_Packet = 25;
799800

800801
uint8_t n_Packets = (dp->points_in_plot+(Datatpoints_per_Packet-1))/ Datatpoints_per_Packet; // integer division rounded up
801802

@@ -807,14 +808,14 @@ void diag_pulse_send(diag_pulseType *dp){
807808

808809

809810
InitScreen_AddLine("Sending I data...",0);
810-
diag_send_sub_packets(dp,GET_PULSE_I,diag_send_buffer,n_Packets);
811+
diag_send_sub_packets(dp,GET_PULSE_I,n_Packets);
811812

812813

813814
_delay_ms(2000);
814815

815816

816817
InitScreen_AddLine("Sending U data...",0);
817-
diag_send_sub_packets(dp,GET_PULSE_U,diag_send_buffer,n_Packets);
818+
diag_send_sub_packets(dp,GET_PULSE_U,n_Packets);
818819

819820

820821

@@ -833,7 +834,7 @@ void diag_pulse_send(diag_pulseType *dp){
833834
}
834835

835836

836-
void diag_send_sub_packets(diag_pulseType *dp,uint8_t Message_code,uint8_t * diag_send_buffer,uint8_t n_Packets){
837+
void diag_send_sub_packets(diag_pulseType *dp,uint8_t Message_code,uint8_t n_Packets){
837838
uint16_t points_sent = 0;
838839
uint8_t header_offset = 11;
839840

@@ -843,7 +844,7 @@ void diag_send_sub_packets(diag_pulseType *dp,uint8_t Message_code,uint8_t * dia
843844
diag_send_buffer[7]= i+1;
844845

845846
//number of Datapoints in fragment
846-
uint8_t datapoints_in_fragment = ((dp->points_in_plot - points_sent) > 30) ? 30 : (dp->points_in_plot - points_sent);
847+
uint8_t datapoints_in_fragment = ((dp->points_in_plot - points_sent) > 25) ? 25 : (dp->points_in_plot - points_sent);
847848
diag_send_buffer[8] = ((uint16_t)dp->delta_t_points)>>8;
848849
diag_send_buffer[9] = (uint16_t)dp->delta_t_points;
849850
diag_send_buffer[10] = datapoints_in_fragment;

diag_pulse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ void diag_pulse_Measure(diag_pulseType *dp);
3737
void diag_pulse_move_cursor(diag_pulseType *dp,int8_t direction);
3838
void diag_pulse_send(diag_pulseType *dp);
3939
void diag_pulse(diag_pulseType *dp);
40-
void diag_send_sub_packets(diag_pulseType *dp,uint8_t Message_code,uint8_t * diag_send_buffer,uint8_t n_Packets);
40+
void diag_send_sub_packets(diag_pulseType *dp,uint8_t Message_code,uint8_t n_Packets);
4141

4242
#endif /* DIAG_PULSE_H_ */

0 commit comments

Comments
 (0)