Skip to content

Instantly share code, notes, and snippets.

View petabyt's full-sized avatar

Daniel C petabyt

View GitHub Profile
int get_current_task_id();
struct B {
int task_id;
char *task_name;
int priority;
int stack_size;
void (*entry)();
void *params; // ?
};
@petabyt
petabyt / ptp_working.c
Created November 21, 2022 23:35
Finally working PTP example for win32
#include <stdio.h>
#include <stdint.h>
#include <windows.h>
#include <winbase.h>
#include <devguid.h>
#include <regstr.h>
#include <winuser.h>
#include <devpkey.h>
#include <initguid.h>
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
@petabyt
petabyt / build.c
Created November 18, 2022 21:49
next generation build system
#include <build.h>
int my_clean() {
return build_shell(build_rm, "-rf", "*.o");
}
int my_out(char *in, char *out) {
return build_shell(build_cc, in, "-o", out);
}
@petabyt
petabyt / canon.h
Created November 9, 2022 19:21
canon.h
// Canon EvProc Vendor commands
#define PTP_OC_CANON_ActivateOperations 0x9050
#define PTP_OC_CANON_TerminateEventProc_051 0x9051
#define PTP_OC_CANON_ExecuteEventProc 0x9052
#define PTP_OC_CANON_GetEventProcReturnData 0x9053
#define PTP_OC_CANON_IsEventProcRunning 0x9057
#define PTP_OC_CANON_GetSizeOfTransparentMemory 0x9058
#define PTP_OC_CANON_LoadTransparentMemory 0x9059
#define PTP_OC_CANON_SaveTransparentMemory 0x905a
#define PTP_OC_CANON_QuickLoadTransparentMemory 0x905b
@petabyt
petabyt / main.c
Created September 28, 2022 18:09
ml-liveview-ptp-module
#include <stdio.h>
#include <dryos.h>
#include <module.h>
#include <menu.h>
#include <config.h>
#include <bmp.h>
#include <console.h>
#include <math.h>
#include <ptp.h>
0b 02 00 00 02 00 01 10 01 00 00 00 64 00 06 00 00 00 64 00 00 00 00 0a7 00 00 00 14 10 15 10 16 10 01 10 02 10 03 10 06 10 04 10 01 091 05 10 02 091 07 10 08 10 03 091 09 10 04 091 0a 10 1b 10 07 091 0c 10 0d 10 0b 10 05 091 f 10 06 091 10 091 27 091 0b 091 08 091 09 091 0c 091 0e 091 f 091 15 091 14 091 13 091 16 091 17 091 20 091 0f0 091 18 091 21 091 0f1 091 1d 091 0a 091 1b 091 1c 091 1e 091 1a 091 53 091 54 091 60 091 55 091 57 091 58 091 59 091 5a 091 1f 091 0fe 091 0ff 091 28 091 29 091 2d 091 2e 091 2f 091 2c 091 30 091 31 091 32 091 33 091 34 091 2b 091 35 091 36 091 37 091 38 091 39 091 3a 091 3b 091 3c 091 0da 091 0db 091 0dc 091 0dd 091 0de 091 0d8 091 0d9 091 0d7 091 0d5 091 2f 090 41 091 42 091 43 091 3f 091 33 090 68 090 69 090 6a 090 6b 090 6c 090 6d 090 6e 090 6f 090 3d 091 080 091 081 091 082 091 083 091 084 091 085 091 40 091 01 098 02 098 03 098 04 098 05 098 0c0 091 0c1 091 0c2 091 0c3 091 0c4 091 0c5 091 0c6 091 0c7 091 0c8 091 0c9 091 0ca 091 0cb 091 0cc 091 0ce 091 0cf 091 0d0 091 0d1
@petabyt
petabyt / Makefile
Created July 3, 2022 19:45
deep sky stacker server
all:
python3 main.py
"/home/daniel/.steam/steam/steamapps/common/Proton 7.0/dist/bin/wine" DSS/DeepSkyStackerCL.exe /r /s list.txt
# Makefile to compile DeepSkyStackerCL
# Written by Daniel Cook @petabyt
CPP=c++
IN_FILES=DeepSkyStackerCL.cpp stdafx.cpp
OUT_FILES=$(IN_FILES:.cpp=.o)
CPPFLAGS=-std=c++11 -fmax-errors=1
@petabyt
petabyt / log
Created May 31, 2022 20:09
dss-vs
This file has been truncated, but you can view the full file.
Rebuild started...
1>------ Rebuild All started: Project: libjpg, Configuration: Debug x64 ------
2>------ Rebuild All started: Project: libtiff, Configuration: Debug x64 ------
3>------ Rebuild All started: Project: ZCLass, Configuration: Debug x64 ------
4>------ Rebuild All started: Project: libraw, Configuration: Debug x64 ------
4>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
4>Trying to import C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\$(MSBuildToolsVersion)\Microsoft.Common.props using extensions path C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild
4>Property reassignment: $(MSBuildProjectExtensionsPath)="C:\msys64\home\brikb\DSS\LibRaw\buildfiles\obj\" (previous value: "obj\") at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Microsoft.Common.props (57,5)
4>Search paths being used for $(MSBuildExtensionsPath) a