Skip to content

Commit

Permalink
further improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
orgua committed Apr 30, 2024
1 parent db72836 commit d36e575
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions software/firmware/pru1-shepherd-fw/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ int32_t event_loop(volatile struct SharedMem *const shared_mem)
continue; // for more regular gpio-sampling
}

/* [Event 2] Timer compare 0 handle -> trigger for buffer swap on pru0 */
/* [Event 2] Timer compare 0 handle -> buffer swap on pru0 */
if (shared_mem->cmp0_trigger_for_pru1)
{
DEBUG_EVENT_STATE_2;
Expand All @@ -365,6 +365,7 @@ int32_t event_loop(volatile struct SharedMem *const shared_mem)
pru0_sum_ticks_for_buffer = 0;
pru0_max_ticks_per_sample = 0;
}
// TODO: add warning for when sync not idle?

/* more maintenance */
last_analog_sample_ticks = 0;
Expand All @@ -373,7 +374,7 @@ int32_t event_loop(volatile struct SharedMem *const shared_mem)
continue; // for more regular gpio-sampling
}

/* [Event 3] Timer compare 1 handle -> trigger for analog sample on pru0 */
/* [Event 3] Timer compare 1 handle -> analog sampling on pru0 */
if (shared_mem->cmp1_trigger_for_pru1)
{
/* prevent a race condition (cmp0_event has to happen before cmp1_event!) */
Expand Down
5 changes: 4 additions & 1 deletion software/kernel-module/src/pru_msg_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ static enum hrtimer_restart coordinator_callback(struct hrtimer *timer_for_resta
"-> backpressure (val=%u)",
had_work & 1u, pru_msg.value[0]);
break;
case MSG_ERR_INCMPLT:
case MSG_ERR_INVLDCMD:
case MSG_ERR_NOFREEBUF: break;
case MSG_ERR_TIMESTAMP:
printk(KERN_ERR "shprd.pru%u: received timestamp is faulty (val=%u)",
had_work & 1u, pru_msg.value[0]);
Expand All @@ -255,7 +258,7 @@ static enum hrtimer_restart coordinator_callback(struct hrtimer *timer_for_resta
break;
default:
/* these are all handled in userspace and will be passed by sys-fs */
printk(KERN_ERR "shprd.k: received invalid command / msg-type (%02X) "
printk(KERN_ERR "shprd.k: received invalid command / msg-type (0x%02X) "
"from pru%u",
pru_msg.type, had_work & 1u);
}
Expand Down
4 changes: 2 additions & 2 deletions software/python-package/shepherd_sheep/shepherd_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def run(self) -> None:
idx, emu_buf = self.get_buffer(verbose=self.verbose_extra)

if emu_buf.timestamp_ns / 1e9 >= ts_end:
log.warning("UNEXPECTED! Out of bound timestamp collected -> begin to exit now")
log.debug("FINISHED! Out of bound timestamp collected -> begin to exit now")
break

if self.writer is not None:
Expand All @@ -257,7 +257,7 @@ def run(self) -> None:
while True:
idx, emu_buf = self.get_buffer(verbose=self.verbose_extra)
if emu_buf.timestamp_ns / 1e9 >= ts_end:
log.warning("UNEXPECTED! Out of bound timestamp collected -> begin to exit now")
log.debug("FINISHED! Out of bound timestamp collected -> begin to exit now")
return
if self.writer is not None:
self.writer.write_buffer(emu_buf)
Expand Down

0 comments on commit d36e575

Please sign in to comment.