zmiany w kodzie c ollama-minimax

This commit is contained in:
2026-02-19 15:01:20 +01:00
parent d086ef28de
commit 62b5fc2e63
12 changed files with 439 additions and 6 deletions

View File

@@ -4,6 +4,15 @@
#include <string.h>
#include <math.h>
// Dodatkowe includy potrzebne do kompilacji
#include "analog_in.h"
// Funkcja pomocnicza do odczytu stanu binary_io
static inline int get_binary_io_val(struct binary_io *b) {
if (!b || !b->ptr) return 0;
return (*b->ptr & b->bit_mask) != 0;
}
// Definicja "uchwytu". Ta struktura przechowuje wszystko, co jest potrzebne do działania algorytmu.
// Jest niewidoczna dla Pythona.
struct ZDistA_handle {
@@ -187,11 +196,11 @@ DLL_EXPORT int ZDistA_step(
// 4. Sprawdź, czy którekolwiek z wyjść jest aktywne
struct ZDistA_komp_logic* log = &handle->logic;
if (log->P1_L1E.val || log->P1_L2E.val || log->P1_L3E.val ||
log->P1_L1L2.val || log->P1_L2L3.val || log->P1_L3L1.val) {
if (get_binary_io_val(&log->P1_L1E) || get_binary_io_val(&log->P1_L2E) || get_binary_io_val(&log->P1_L3E) ||
get_binary_io_val(&log->P1_L1L2) || get_binary_io_val(&log->P1_L2L3) || get_binary_io_val(&log->P1_L3L1)) {
return 1;
}
return 0;
}