Using comptime function that require option will end in declaration loop
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 22/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Domínio
- embedded-iot
Direção de pesquisa
The payload names no file paths. Start from the DMA function in the snippet and from where microzig_options redefines std_option, since the declaration loop comes from that shadowing. Reproduce by putting a DMA_Handler that calls std.fmt.comptimePrint inside microzig_options. Done means that build compiles without the declaration loop error, or the issue records why the shadowed std_option cannot be avoided.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Microzig redefine the std_option with specific entry for embedded device. Like interrupt or chip/hal config.
By doing so it allow users to fine tune the MCU. This have some limitation on how microzig_options can be initialized.
std_option is being shadow and whenever attribute inside the microzig_options need std_option it will trigger a declaration loop error.
This happen for example when you want to format string:
pub fn DMA(index: u32, channel: u32) type {
// /!\ This line will trigger the declaration loop if you include the DMA_Handler
// inside the microzig_option since this comptimePrint needs std_option.
const interrupt_name = std.fmt.comptimePrint("DMA{}_Channel{}", .{ index, ch});
const interrupt_index = blk: for (microzig.chip.interrupts) |*interrupt| {
if (std.mem.eql(u8, interrupt_name, interrupt.name)) {
break :blk interrupt.index;
}
} else @panic("Interrupt index not found");
return struct {
var channel: ?Channel = null;
pub fn DMA_Handler() callconv(.c) void {
const event = read_events();
clear_events(event);
if (channel) |*init_chan| {
init_chan.deliver_event(event);
}
}
...
}
...
}
- Linguagem predominante
- Zig
- Estrelas
- 2.3k
- Forks
- 198
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 37
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de ZigEmbeddedGroup/microzig
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
ZigEmbeddedGroup/microzig#1086 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 69/100
ZigEmbeddedGroup/microzig#1085 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
ZigEmbeddedGroup/microzig#1061 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
ZigEmbeddedGroup/microzig#1059 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
regz: AVR peripherals generated at address 0 when the register-group name matches the module (ATDF)Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
ZigEmbeddedGroup/microzig#1072 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de ZigEmbeddedGroup/microzig
Issues semelhantes
-
area: core priority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
EPFL-TOP/smart-microscope-control#132 ·
Mantenedores costumam responder em até 1 dia
-
scope:mqtt-bridge type:feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
bvis/aegis-hass#588 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
integration: homewizard
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
home-assistant/core#186409 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
joleys/niko-home-control-II#321 ·