[video member=miotatsu stream_platform=twitch project=riscy title="Studying global-interrupts Demo" vod_platform=youtube id=4tcmcIG7tZY annotator=Miblo]
[0:07][Recap and set the stage for the day]
[1:08][@bananathemonkey][It looks like it's a single bit mask for a 32b field where the lower 16b are reserved for something (local interrupts, maybe?)]
[1:48][Continue to study local_interrupts.c on the software and timer interrupt handler, and debouncing][:"input handling" :research :timing]
[3:53][@riskyfive][Because the metal actually physically bounces, before making permanent electrical contact]
[5:03][@riskyfive][A button is not a piece of solid metal, it has two faces that make contact]
[6:17][@bananathemonkey][A 0.5s debouncer makes sure it has the same state continuously for 0.5s before it takes that value]
[7:02][@riskyfive][Yes, because the button is not digital, and the signal goes up and down a few times before stabilizing]
[7:18][On :"input handling" and exploiting the code for it in A Link to the Past[ref
    site=YouTube
    page="A Link to the Past - Hovering Hammerbridge"
    url=https://www.youtube.com/watch?v=pnpyNp9pMT8]]
[9:16][@riskyfive][It doesn't need 0.5s, obviously]
[9:21][@bananathemonkey][So you have to hold the button for at least 0.5s for it to be recognized in this case, it would be really bad for gaming]
[9:48][Continue studying local_interrupts.c on debouncing][:"input handling" :research]
[14:52][Briefly check out the product page for the Artix-7 35T Arty FPGA Evaluation Kit[ref
    site=Xilinx
    page="Artix-7 35T Arty FPGA Evaluation Kit"
    url=http://www.xilinx.com/products/boards-and-kits/arty.html]]
[16:53][Plug changes to Twitch channel[ref
    site=Twitch
    page="RISCY BUSINESS"
    url=https://twitch.tv/miotatsu] including a new way to support the series via streamlabs[ref
    site=streamlabs
    page=miotatsu
    url=https://streamlabs.com/miotatsu]]
[20:10][Determine that we have studied local_interrupts.c sufficiently and try to compile it, knowing we won't be able to upload it to our HiFive1]
[22:45][Embark on studying global_interrupts.c][:research]
[32:14][How global_interrupts.c uses a PWM as a timer interrupt for debouncing][:"input handling" :peripheral :research :timing]
[36:39][Study main() in global_interrupts.c][:research]
[37:44][@riskyfive][Good night]
[37:49][Continue studying main() in global_interrupts.c, setting up the PWM and LEDs][:peripheral :research]
[41:59][Hunt for wfi in the RISC-V reference card and documentation][:asm :research]
[46:01][Read about Wait for Interrupt (WFI) in the Privileged ISA Specification[ref
    site="RISC-V"
    page="Draft Privileged ISA Specification v1.9.1"
    url=https://riscv.org/specifications/privileged-isa/]][:asm :research]
[53:26][Determine that we understand global_interrupts.c, and consider what to review][:research]
[56:12][Review the PWM Configuration Register (pwmcfg)[ref
    site="SiFive Developers"
    page="Platform Reference Manual"
    url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]][:peripheral :research]
[1:01:37][Read about the Deglitch and Sticky circuitry, and the pwmscale field[ref
    site="SiFive Developers"
    page="Platform Reference Manual"
    url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]][:peripheral :research]
[1:07:44][Read how global_interrupts.c sets up the PWM_CMP registers for debouncing][:peripheral :research]
[1:10:38][Wrap it up with the determination to continue studying this in another episode]
[/video]
