bandit1976
Inventar
- 16.038
den Hyper würde ich gerne testen, nur weiß ich nicht wirklich welche Verison es bei den Downloads ist bzw. wie ich ihn wo aktivieren kann..
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion erfordert derzeit den Zugriff auf die Seite über den integrierten Safari-Browser.
ocp11 schrieb:hier einmal mit google und einmal mit lg farbprofil
/******************* begin faux123 sysfs interface *******************/
static bool calc_checksum(int intArr[]) {
int i = 0;
unsigned char chksum = 0;
if (intArr[5] > 31 || (intArr[6] > 31)) {
pr_info("gamma 0 and gamma 1 values can't be over 31, got %d %d instead!", intArr[5], intArr[6]);
return false;
}
for (i=1; i<10; i++) {
if (intArr[i] > 255) {
pr_info("color values can't be over 255, got %d instead!", intArr[i]);
return false;
}
chksum += intArr[i];
}
if (chksum == (unsigned char)intArr[0]) {
return true;
} else {
pr_info("expecting %d, got %d instead!", chksum, intArr[0]);
return false;
}
}
static ssize_t kgamma_r_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int kgamma[10];
int i;
sscanf(buf, "%d %d %d %d %d %d %d %d %d %d",
&kgamma[0], &kgamma[1], &kgamma[2], &kgamma[3],
&kgamma[4], &kgamma[5], &kgamma[6], &kgamma[7],
&kgamma[8], &kgamma[9]);
if (calc_checksum(kgamma)) {
kgamma[0] = 0xd0;
for (i=0; i<10; i++) {
pr_info("kgamma_r_p [%d] => %d \n", i, kgamma[i]);
new_color_vals[5].payload[i] = kgamma[i];
}
kgamma[0] = 0xd1;
for (i=0; i<10; i++) {
pr_info("kgamma_r_n [%d] => %d \n", i, kgamma[i]);
new_color_vals[6].payload[i] = kgamma[i];
}
}
return count;
}
static ssize_t kgamma_r_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
int kgamma[10];
int i;
for (i=0; i<10; i++)
kgamma[i] = new_color_vals[5].payload[i];
return sprintf(buf, "%d %d %d %d %d %d %d %d %d %d",
kgamma[0], kgamma[1], kgamma[2], kgamma[3],
kgamma[4], kgamma[5], kgamma[6], kgamma[7],
kgamma[8], kgamma[9]);
}
static ssize_t kgamma_g_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int kgamma[10];
int i;
sscanf(buf, "%d %d %d %d %d %d %d %d %d %d",
&kgamma[0], &kgamma[1], &kgamma[2], &kgamma[3],
&kgamma[4], &kgamma[5], &kgamma[6], &kgamma[7],
&kgamma[8], &kgamma[9]);
if (calc_checksum(kgamma)) {
kgamma[0] = 0xd2;
for (i=0; i<10; i++) {
pr_info("kgamma_g_p [%d] => %d \n", i, kgamma[i]);
new_color_vals[7].payload[i] = kgamma[i];
}
kgamma[0] = 0xd3;
for (i=0; i<10; i++) {
pr_info("kgamma_g_n [%d] => %d \n", i, kgamma[i]);
new_color_vals[8].payload[i] = kgamma[i];
}
}
return count;
}
static ssize_t kgamma_g_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
int kgamma[10];
int i;
for (i=0; i<10; i++)
kgamma[i] = new_color_vals[7].payload[i];
return sprintf(buf, "%d %d %d %d %d %d %d %d %d %d",
kgamma[0], kgamma[1], kgamma[2], kgamma[3],
kgamma[4], kgamma[5], kgamma[6], kgamma[7],
kgamma[8], kgamma[9]);
}
static ssize_t kgamma_b_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int kgamma[10];
int i;
sscanf(buf, "%d %d %d %d %d %d %d %d %d %d",
&kgamma[0], &kgamma[1], &kgamma[2], &kgamma[3],
&kgamma[4], &kgamma[5], &kgamma[6], &kgamma[7],
&kgamma[8], &kgamma[9]);
if (calc_checksum(kgamma)) {
kgamma[0] = 0xd4;
for (i=0; i<10; i++) {
pr_info("kgamma_b_p [%d] => %d \n", i, kgamma[i]);
new_color_vals[9].payload[i] = kgamma[i];
}
kgamma[0] = 0xd5;
for (i=0; i<10; i++) {
pr_info("kgamma_b_n [%d] => %d \n", i, kgamma[i]);
new_color_vals[10].payload[i] = kgamma[i];
}
}
return count;
}
static ssize_t kgamma_b_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
int kgamma[10];
int i;
for (i=0; i<10; i++)
kgamma[i] = new_color_vals[9].payload[i];
return sprintf(buf, "%d %d %d %d %d %d %d %d %d %d",
kgamma[0], kgamma[1], kgamma[2], kgamma[3],
kgamma[4], kgamma[5], kgamma[6], kgamma[7],
kgamma[8], kgamma[9]);
}
static ssize_t kgamma_ctrl_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
pr_info("kgamma_ctrl count: %d\n", count);
return count;
}
static ssize_t kgamma_ctrl_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return 0;
}
static DEVICE_ATTR(kgamma_r, 0644, kgamma_r_show, kgamma_r_store);
static DEVICE_ATTR(kgamma_g, 0644, kgamma_g_show, kgamma_g_store);
static DEVICE_ATTR(kgamma_b, 0644, kgamma_b_show, kgamma_b_store);
static DEVICE_ATTR(kgamma_ctrl, 0644, kgamma_ctrl_show, kgamma_ctrl_store);
/******************* end faux123 sysfs interface *******************/
/******************* motley sysfs interface ********************/
/** check for for reasonable values and ones that are too large for the
* destination char data type
* */
static bool calc_checksum_generic(unsigned int intArr[]) {
int i = 0;
unsigned int chksum = 0;
if (intArr[5] > 31 || (intArr[6] > 31)) {
pr_info("gamma 0 and gamma 1 values can't be over 31, got %d %d instead!", intArr[5], intArr[6]);
return false;
}
for (i=1; i<10; i++) {
if (intArr[i] > 255) {
pr_info("char values can't be over 255, got %d instead!", intArr[i]);
return false;
}
chksum += intArr[i];
}
if (chksum == intArr[0]) {
return true;
} else {
pr_info("expecting %d, got %d instead!", chksum, intArr[0]);
return false;
}
}
static ssize_t kgamma_red_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
unsigned int kgamma[10];
int i;
sscanf(buf, "%d %d %d %d %d %d %d %d %d %d",
&kgamma[0], &kgamma[1], &kgamma[2], &kgamma[3],
&kgamma[4], &kgamma[5], &kgamma[6], &kgamma[7],
&kgamma[8], &kgamma[9]);
if (calc_checksum_generic(kgamma)) {
kgamma[0] = 0xd0;
for (i=0; i<10; i++) {
pr_info("kgamma_r_p [%d] => %d \n", i, kgamma[i]);
new_color_vals[5].payload[i] = (char)kgamma[i];
}
kgamma[0] = 0xd1;
for (i=0; i<10; i++) {
pr_info("kgamma_r_n [%d] => %d \n", i, kgamma[i]);
new_color_vals[6].payload[i] = (char)kgamma[i];
}
}
return count;
}
static ssize_t kgamma_red_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
unsigned int kgamma[10];
int i;
unsigned int check_sum =0;
for (i=1; i<10; i++) {
kgamma[i] = (unsigned int)new_color_vals[5].payload[i];
check_sum += kgamma[i];
}
kgamma[0] = check_sum;
return sprintf(buf, "%d %d %d %d %d %d %d %d %d %d",
kgamma[0], kgamma[1], kgamma[2], kgamma[3],
kgamma[4], kgamma[5], kgamma[6], kgamma[7],
kgamma[8], kgamma[9]);
}
static ssize_t kgamma_green_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
unsigned int kgamma[10];
int i;
sscanf(buf, "%d %d %d %d %d %d %d %d %d %d",
&kgamma[0], &kgamma[1], &kgamma[2], &kgamma[3],
&kgamma[4], &kgamma[5], &kgamma[6], &kgamma[7],
&kgamma[8], &kgamma[9]);
if (calc_checksum_generic(kgamma)) {
kgamma[0] = 0xd2;
for (i=0; i<10; i++) {
pr_info("kgamma_g_p [%d] => %d \n", i, kgamma[i]);
new_color_vals[7].payload[i] = (char)kgamma[i];
}
kgamma[0] = 0xd3;
for (i=0; i<10; i++) {
pr_info("kgamma_g_n [%d] => %d \n", i, kgamma[i]);
new_color_vals[8].payload[i] = (char)kgamma[i];
}
}
return count;
}
static ssize_t kgamma_green_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
unsigned int kgamma[10];
int i;
unsigned int check_sum =0;
for (i=1; i<10; i++) {
kgamma[i] = (unsigned int)new_color_vals[7].payload[i];
check_sum += kgamma[i];
}
kgamma[0] = check_sum;
return sprintf(buf, "%d %d %d %d %d %d %d %d %d %d",
kgamma[0], kgamma[1], kgamma[2], kgamma[3],
kgamma[4], kgamma[5], kgamma[6], kgamma[7],
kgamma[8], kgamma[9]);
}
static ssize_t kgamma_blue_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
unsigned int kgamma[10];
int i;
sscanf(buf, "%d %d %d %d %d %d %d %d %d %d",
&kgamma[0], &kgamma[1], &kgamma[2], &kgamma[3],
&kgamma[4], &kgamma[5], &kgamma[6], &kgamma[7],
&kgamma[8], &kgamma[9]);
if (calc_checksum_generic(kgamma)) {
kgamma[0] = 0xd4;
for (i=0; i<10; i++) {
pr_info("kgamma_b_p [%d] => %d \n", i, kgamma[i]);
new_color_vals[9].payload[i] = (char)kgamma[i];
}
kgamma[0] = 0xd5;
for (i=0; i<10; i++) {
pr_info("kgamma_b_n [%d] => %d \n", i, kgamma[i]);
new_color_vals[10].payload[i] = (char)kgamma[i];
}
}
return count;
}
static ssize_t kgamma_blue_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
unsigned int kgamma[10];
int i;
unsigned int check_sum =0;
for (i=1; i<10; i++) {
kgamma[i] = (unsigned int)new_color_vals[9].payload[i];
check_sum += kgamma[i];
}
kgamma[0] = check_sum;
return sprintf(buf, "%d %d %d %d %d %d %d %d %d %d",
kgamma[0], kgamma[1], kgamma[2], kgamma[3],
kgamma[4], kgamma[5], kgamma[6], kgamma[7],
kgamma[8], kgamma[9]);
}
static ssize_t refresh_screen_go (struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) {
unsigned int i = 0;
int ret = 0;
sscanf(buf, "%i", &i);
if (i == 1) {
msleep(20);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);
ret = mipi_dsi_cmds_tx(&lgit_tx_buf,
new_color_vals,
mipi_lgit_pdata->power_on_set_size_1);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);
if (ret < 0)
pr_err("%s: failed to transmit power_on_set_1 cmds\n", __func__);
}
return count;
}
static ssize_t refresh_screen_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
return sprintf(buf, "%d", 0);
}
static DEVICE_ATTR(kgamma_red, 0644, kgamma_red_show, kgamma_red_store);
static DEVICE_ATTR(kgamma_green, 0644, kgamma_green_show, kgamma_green_store);
static DEVICE_ATTR(kgamma_blue, 0644, kgamma_blue_show, kgamma_blue_store);
static DEVICE_ATTR(refresh_screen, 0644, refresh_screen_show, refresh_screen_go);
/******************* end motley sysfs interface ********************/
hellsgod schrieb: