Send CT_END on chanend before closing it, to prevent illegal resource exception.

This commit is contained in:
Russell
2012-01-09 14:48:55 +00:00
parent 8b0ad92d87
commit 3141dec113
2 changed files with 89 additions and 59 deletions

View File

@@ -7,6 +7,7 @@ int write_sswitch_reg_blind(unsigned coreid, unsigned reg, unsigned data);
/* Reboots XMOS device by writing to the PLL config register */
void device_reboot(chanend spare)
{
outct(spare, XS1_CT_END); // have to do this before freeing the chanend
// Need a spare chanend so we can talk to the pll register
asm("freer res[%0]"::"r"(spare));
// Need to tell the mapper we have freed one