Update barcode gen

This commit is contained in:
Willy-JL
2023-07-14 03:18:52 +02:00
parent 49fe96247a
commit 00771df0c3
6 changed files with 153 additions and 7 deletions

View File

@@ -43,6 +43,14 @@ void init_types() {
code_128->start_pos = 0;
barcode_type_objs[CODE128] = code_128;
BarcodeTypeObj* code_128c = malloc(sizeof(BarcodeTypeObj));
code_128c->name = "CODE-128C";
code_128c->type = CODE128C;
code_128c->min_digits = 2;
code_128c->max_digits = -1;
code_128c->start_pos = 0;
barcode_type_objs[CODE128C] = code_128c;
BarcodeTypeObj* codabar = malloc(sizeof(BarcodeTypeObj));
codabar->name = "Codabar";
codabar->type = CODABAR;
@@ -82,6 +90,9 @@ BarcodeTypeObj* get_type(FuriString* type_string) {
if(furi_string_cmp_str(type_string, "CODE-128") == 0) {
return barcode_type_objs[CODE128];
}
if(furi_string_cmp_str(type_string, "CODE-128C") == 0) {
return barcode_type_objs[CODE128C];
}
if(furi_string_cmp_str(type_string, "Codabar") == 0) {
return barcode_type_objs[CODABAR];
}
@@ -133,4 +144,4 @@ const char* get_error_code_message(ErrorCode error_code) {
default:
return "Could not read barcode data";
};
}
}