aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode/process_midi.h
diff options
context:
space:
mode:
authorLucas Moreira <hello@lucasmoreira.dev>2020-01-07 20:28:06 -0500
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2020-01-07 17:28:06 -0800
commitfdc144d215b59a5bc3f3283b159895ec42ccba0b (patch)
tree4cfae7c8c7baf75aebbbbf4db828ce8a641dffb6 /quantum/process_keycode/process_midi.h
parentee70d496f44f43b5fd0e7b3a94db4dc467725e1e (diff)
downloadfirmware-fdc144d215b59a5bc3f3283b159895ec42ccba0b.tar.gz
firmware-fdc144d215b59a5bc3f3283b159895ec42ccba0b.tar.bz2
firmware-fdc144d215b59a5bc3f3283b159895ec42ccba0b.zip
[Keymap] Improvements to KidBrazil keymap to better handle OLED/LED Matrix timeout. (#7688)
* Added KidBrazil custom keymap for CRKBD -Custom Font -Custom OLED output * Added missing readme * Oled Timeout Update for KidBrazil Keymap (#1) * Setup Oled timeout based on simple timer * Cleaned up comments and added timeout for LEDs * Fixed some small errors * Updated oled timout with matrix scan * Updated oled timout with matrix scan * Update withou eeprom * Update timer code * Use process user instead of keymap * Added ifdef to protect oledtimer * Updated with half timeout state for logo * Removed middle tier timer * Final cleanup of unused files * Updated code as per suggestions & requests * Second round of revisions * Updated keymap to better handle LED timeout - Added boolean to hold LED state - Added init function to set rgb to known state - Modified RGB_TOG to work with noeeprom commands * Finished adding the timeout for OLED and testing on CRKBD * Updated documentation * fixed the timeout logic so it works as intended * Update keyboards/crkbd/keymaps/kidbrazil/README.md
Diffstat (limited to 'quantum/process_keycode/process_midi.h')
0 files changed, 0 insertions, 0 deletions
teral.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity ent is
	generic (NUM_CHANNELS : natural := 4);
	port (
		iar   : in  unsigned(15 downto 0);
		ipend : in  unsigned(NUM_CHANNELS-1 downto 0);
		irq   : out unsigned(3 downto 0);
		clk   : in std_logic
	);
end;

architecture a of ent is
	type irq_t is
		array (integer range 0 to 4-1) of unsigned(NUM_CHANNELS-1 downto 0);

	signal imap : irq_t;

	function or_reduce (v: in unsigned) return std_logic is
		variable rv : std_logic := '0';
	begin
		for i in v'range loop
			rv := rv or v(i);
		end loop;
		return rv;
	end function;


begin

gen_irqmap:
  for i in 0 to 4-1 generate
	irq(i) <= or_reduce(imap(i));
  end generate;

irq_map:
	process (clk)
		variable itmp : irq_t := (others => (others => '0'));
	begin
		-- IRQ channel assignment:
		if rising_edge(clk) then
			for i in 0 to NUM_CHANNELS-1 loop
				itmp(to_integer(iar(i*2+1 downto i*2)))(i) := ipend(i);
			end loop;
			imap <= itmp;
		end if;
	end process;
end;