Abdullah Wasiq commented on a discussion on scrutiny/init/test.c: https://gitlab.rtems.org/rtems/rtos/rtems-examples/-/merge_requests/34#note_158531 > + uint32_t timestamp = ( ts.tv_sec * 1000000 ) + ( ts.tv_nsec / 1000 ); > + uint32_t time_delta = timestamp - last_timestamp; > + ssize_t bytes = read( USART2, in_buffer, sizeof(in_buffer) ); > + > + if ( bytes > 0 ) { > + scrutiny_c_main_handler_receive_data( scrutiny_handler, in_buffer, > (uint16_t)bytes ); > + } > + > + scrutiny_c_main_handler_process( scrutiny_handler, time_delta * 10U ); > + scrutiny_c_loop_handler_variable_freq_process( task_idle_lh, time_delta > * 10U ); > + > + uint16_t to_send = scrutiny_c_main_handler_data_to_send( > scrutiny_handler ); > + > + if ( to_send > 0 ) { > + uint16_t sent = scrutiny_c_main_handler_pop_data( scrutiny_handler, > out_buffer, sizeof(out_buffer) ); > + write( USART2, out_buffer, sent ); I'll try, but one thing I had mind was to add more transport examples later under different files However for this block of code specifically I don't know how exactly to approach making it more modular for different transports, wouldn't it just refactor the entire function? I could try adding comments before specific regions indicating that this part of the code should be changed if you are using a different transport. But those comments could also be wrong since I haven't tested CAN or UDP, only USART -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems-examples/-/merge_requests/34#note_158531 You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/5-b5hx1veu3etl5c5yk5q9vnvbo-9/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
