OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [lib/] [source/] [neorv32_xirq.c] - Diff between revs 69 and 73

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 69 Rev 73
Line 1... Line 1...
// #################################################################################################
// #################################################################################################
// # << NEORV32: neorv32_xirq.c - External Interrupt controller HW Driver >>                       #
// # << NEORV32: neorv32_xirq.c - External Interrupt controller HW Driver >>                       #
// # ********************************************************************************************* #
// # ********************************************************************************************* #
// # BSD 3-Clause License                                                                          #
// # BSD 3-Clause License                                                                          #
// #                                                                                               #
// #                                                                                               #
// # Copyright (c) 2021, Stephan Nolting. All rights reserved.                                     #
// # Copyright (c) 2022, Stephan Nolting. All rights reserved.                                     #
// #                                                                                               #
// #                                                                                               #
// # Redistribution and use in source and binary forms, with or without modification, are          #
// # Redistribution and use in source and binary forms, with or without modification, are          #
// # permitted provided that the following conditions are met:                                     #
// # permitted provided that the following conditions are met:                                     #
// #                                                                                               #
// #                                                                                               #
// # 1. Redistributions of source code must retain the above copyright notice, this list of        #
// # 1. Redistributions of source code must retain the above copyright notice, this list of        #
Line 236... Line 236...
  register uint32_t src = NEORV32_XIRQ.SCR; // get IRQ source (with highest priority)
  register uint32_t src = NEORV32_XIRQ.SCR; // get IRQ source (with highest priority)
 
 
  uint32_t mask = 1 << src;
  uint32_t mask = 1 << src;
  NEORV32_XIRQ.IPR = ~mask; // clear current pending interrupt
  NEORV32_XIRQ.IPR = ~mask; // clear current pending interrupt
 
 
  neorv32_cpu_csr_write(CSR_MIP, 1 << XIRQ_FIRQ_PENDING); // acknowledge XIRQ FIRQ
  neorv32_cpu_csr_write(CSR_MIP, ~(1 << XIRQ_FIRQ_PENDING)); // acknowledge XIRQ FIRQ
 
 
  NEORV32_XIRQ.SCR = 0; // acknowledge current XIRQ interrupt source
  NEORV32_XIRQ.SCR = 0; // acknowledge current XIRQ interrupt source
 
 
  // execute handler
  // execute handler
  register uint32_t xirq_handler = __neorv32_xirq_vector_lut[src];
  register uint32_t xirq_handler = __neorv32_xirq_vector_lut[src];

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.