Using comptime function that require option will end in declaration loop
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- embedded-iot
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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);
}
}
...
}
...
}
- Lenguaje dominante
- Zig
- Estrellas
- 2.3k
- Forks
- 198
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 37
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ZigEmbeddedGroup/microzig
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
ZigEmbeddedGroup/microzig#1086 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 69/100
ZigEmbeddedGroup/microzig#1085 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ZigEmbeddedGroup/microzig#1061 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ZigEmbeddedGroup/microzig#1059 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
regz: AVR peripherals generated at address 0 when the register-group name matches the module (ATDF)Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
ZigEmbeddedGroup/microzig#1072 ·
Los mantenedores suelen responder en 1 día
Todos los issues de ZigEmbeddedGroup/microzig
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
joleys/niko-home-control-II#321 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
stlink_probe._get_board_id() raises TypeError, not KeyError, when mbed.htm exists but has no TargetIDPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
problem
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Koenkk/zigbee2mqtt#33373 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
microsoft/cheriot-ibex#99 ·