Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

Commit c6dfd5a9 authored by a1ex's avatar a1ex
Browse files

600D: CFn's are similar to 550D

--HG--
branch : unified
parent 03c56aeaff54
#include "../../dryos.h"
#include "../../property.h"
#define PROP_CFN1 0x80010004 // 8 bytes
#define PROP_CFN2 0x80010005 // 4 bytes
#define PROP_CFN3 0x80010006 // 6 bytes
#define PROP_CFN4 0x80010007 // 6 bytes
#define CFN1_LEN 8
#define CFN2_LEN 4
#define CFN3_LEN 6
#define CFN4_LEN 6
#define PROP_CFN 0x80010004 // 13 bytes
#define CFN1_LEN 13
uint32_t cfn1[2];
uint32_t cfn2[1];
uint32_t cfn3[2];
uint32_t cfn4[2];
PROP_HANDLER( PROP_CFN1 )
{
cfn1[0] = buf[0];
cfn1[1] = buf[1];
return prop_cleanup( token, property );
}
PROP_HANDLER( PROP_CFN2 )
{
cfn2[0] = buf[0];
return prop_cleanup( token, property );
}
PROP_HANDLER( PROP_CFN3 )
{
cfn3[0] = buf[0];
cfn3[1] = buf[1] & 0xFFFF;
return prop_cleanup( token, property );
}
PROP_HANDLER( PROP_CFN4 )
{
cfn3[0] = buf[0];
cfn3[1] = buf[1] & 0xFFFF;
uint32_t cfn[4];
PROP_HANDLER( PROP_CFN )
{
cfn[0] = buf[0];
cfn[1] = buf[1];
cfn[2] = buf[2];
cfn[3] = buf[3] & 0xFF;
//~ bmp_printf(FONT_MED, 0, 450, "cfn: %x/%x/%x/%x", cfn[0], cfn[1], cfn[2], cfn[3]);
return prop_cleanup( token, property );
}
int get_htp()
{
if (cfn2[0] & 0x1000000) return 1;
if (cfn[1] & 0x10000) return 1;
return 0;
}
void set_htp(int enable)
{
return; // crash
if (enable) cfn2[0] |= 0x1000000;
else cfn2[0] &= ~0x1000000;
prop_request_change(PROP_CFN2, cfn2, CFN2_LEN);
if (enable) cfn[1] |= 0x10000;
else cfn[1] &= ~0x10000;
prop_request_change(PROP_CFN, cfn, 0xD);
}
void set_mlu(int enable)
{
return; // crash
if (enable) cfn3[1] |= 0x100;
else cfn3[1] &= ~0x100;
prop_request_change(PROP_CFN3, cfn3, CFN3_LEN);
if (enable) cfn[2] |= 0x1;
else cfn[2] &= ~0x1;
prop_request_change(PROP_CFN, cfn, 0xD);
}
int get_mlu()
{
return cfn3[1] & 0x100;
return cfn[2] & 0x1;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment