我想了解ISR(中断服务程序)和函数调用之间的区别.
从硬件的角度来看,我觉得函数调用和ISR都是一样的.如果我错了,请纠正我.我所能找到的有关ISR和函数调用的内容如下:
ISR:
在程序执行期间可能发生的异步事件
将PC,标志和寄存器保存在堆栈中并禁用所有中断并加载ISR的地址
ISR不能有可传递给它的参数
功能:
在有函数调用时发生
将PC和寄存器保存在堆栈中
可以有参数
可以返回值
对执行的大小和持续时间没有限制
除此之外还有什么区别吗?请告诉我.我还读过关于从ISR进行函数调用的方法.请突出显示它.
embedded operating-system function-calls computer-architecture isr
我用 Gradle 和 Kotlin DSL 构建脚本构建了一个新的 IntelliJ 项目,只有 Kotlin (Java) 和 Java 版本 10.0.2 作为项目 SDK。
我将 log4j 的依赖项添加到 build.gradle.kts 中:
compile("org.apache.logging.log4j:log4j-api:2.11.1")
compile("org.apache.logging.log4j:log4j-core:2.11.1")
Run Code Online (Sandbox Code Playgroud)
我将一个 log4j2.yaml 文件放入 /src/main/resources 并进行了一些配置。
当我现在运行这个测试程序时:
import org.apache.logging.log4j.LogManager
fun main(args: Array<String>) {
val logger = LogManager.getLogger()!!
logger.warn("Warn")
logger.info("Info")
logger.debug("Debug")
}
Run Code Online (Sandbox Code Playgroud)
我没有得到日志输出但是这条消息
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for …Run Code Online (Sandbox Code Playgroud)