logoalt Hacker News

NetMageSCWyesterday at 11:55 PM1 replyview on HN

I don’t think making optional what optional features are available is a little mistake. It is a torpedo to the waterline.


Replies

IshKebabtoday at 12:01 AM

It's not. In practice you have two scenarios:

1. You have a microcontroller. You're compiling code yourself and the docs tells you what features are available and which compiler flags to use.

2. You are writing application code. In that case you simply target RVA23.

The edge case is the same edge case where you use CPUID on x86, I.e. you want to target say RVA23 and RVA28 in the same binary. In that case you do have to use the OS APIs to discover what is supported... which is slightly annoying, but in practice you're just calling a different function.

In theory `mconfigptr` will eventually make this a lot nicer but nobody has put in the effort to define how it works yet (last I heard they were looking at ASN.1 sick emoji).

show 3 replies