From b962335de827714070005328d8033adb9b4abb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kov=C3=A1cs?= Date: Fri, 28 Mar 2025 13:40:01 +0100 Subject: [PATCH] feat: fix page_size_max is not set --- src/main.zig | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main.zig b/src/main.zig index 10c15b4..943018a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -9,6 +9,8 @@ const std = @import("std"); const BUTTON_PIN = 15; const GPIO_IN = false; +pub const std_options: std.Options = .{ .page_size_max = 4 * 1024, .page_size_min = 4 * 1024 }; + // Basically the pico_w blink sample export fn main() c_int { _ = p.stdio_init_all(); @@ -37,7 +39,18 @@ export fn main() c_int { // } // _ = p.printf("Hello world\n"); - std.options.page_size_max = 4096; + httpRequest(); + + while (true) { + while (p.gpio_get(BUTTON_PIN)) { + p.cyw43_arch_gpio_put(p.CYW43_WL_GPIO_LED_PIN, true); + p.sleep_ms(50); + } + p.cyw43_arch_gpio_put(p.CYW43_WL_GPIO_LED_PIN, false); + } +} + +fn httpRequest() !void { // Create a general purpose allocator var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); @@ -63,12 +76,4 @@ export fn main() c_int { try req.wait(); std.debug.print("status={d}\n", .{req.response.status}); - - while (true) { - while (p.gpio_get(BUTTON_PIN)) { - p.cyw43_arch_gpio_put(p.CYW43_WL_GPIO_LED_PIN, true); - p.sleep_ms(50); - } - p.cyw43_arch_gpio_put(p.CYW43_WL_GPIO_LED_PIN, false); - } }