Added command line option `--boot0` to run boot0.
Currently boots until jumping to boot1 which results in an undefined instruction without a valid boot1 key, since boot1 couldn't be decrypted.
Renamed `LT_BOOT0` to `LT_SPARE1` since this register handles more than just locking out boot 0.
Handle `LT_SPARE0` and `LT_SPARE1` behaviour used by boot0 mem flushing.
* debugger: Use libreadline for the prompt
This fixes the issue where ^D would put the debugger into an infinite
loop, and adds support for persistent history, with familiar
keybindings.
I originally tried to make this new dependency optional, but your
usage of make doesn’t really tend itself to this, feel free to tell me
if you prefer another option.
Co-authored-by: Yannik Marchand <ymarchand@me.com>
This fixes two things:
You cannot have a std::enable_if on a member function which is only
conditional on the template parameters of the class it belongs to. The
typical way to solve this is by doing redeclaring the type in the function
template, eg:
template<typename T>
class Foo {
template<typename U = T, std::enable_if<is_something<U>> void bar();
}
However that would require usage of the macro to look like:
template<typename U = T, EnableIf(is_something<U>)>
So instead we can make your macro add a bool type to the template paramater
list which is the result of the enable_if, and then use std::enable_if on
that instead, eg:
bool B = (__VA_ARGS__), typename std::enable_if_t<B, int> = 0
However there is one more problem, as you overload your functions with this
macro (eg Matrix::determinant), this leads to both overloads having the
same type signature template<bool B, typename std::enable_if_t<B, int>> so
you end up with duplicated function error.
The way to fix that is to ensure both functions have separate type
signatures, to do that we can repeat the __VA_ARGS__ condition inside the
std::enable_if usage - whilst still being sure to use B to satisfy the
previously mentioned constraint. Which finally leads us to:
bool B = (__VA_ARGS__), typename std::enable_if_t<!B && !(__VA_ARGS__), int> = 0