it's still unclear why it doesn't work without the volatile in line 310