Skip to content

Instantly share code, notes, and snippets.

View Rajssss's full-sized avatar
🎯
Writing Drivers

Rajesh Kumbhakar Rajssss

🎯
Writing Drivers
View GitHub Profile
@Rajssss
Rajssss / format_sdcard.c
Created May 11, 2022 14:27 — forked from dizcza/format_sdcard.c
ESP-IDF format an SD card
#include "ff.h"
#include "vfs_fat_internal.h"
/**
* Usage:
* // See https://github.com/espressif/esp-idf/blob/b63ec47238fd6aa6eaa59f7ad3942cbdff5fcc1f/examples/storage/sd_card/sdmmc/main/sd_card_example_main.c#L75
* esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
* format_sdcard(card);
* // proceed without remounting
*/
I (62080) datoms_generc_protocol: datoms_generic_protocol_get_data: ADAM: Parsing ADAM pkt 43 : #>-4.05-4.15-4.25-4.35+4.45-4.55-4.65-4.75
W (62080) datoms_data_handeling: data_handling_get_pkt: Warning: channel to param conf mismatch detected!!
I (62090) datoms_data_handeling: data_handling_get_pkt: got "PM" value
I (62100) datoms_data_handeling: data_handling_get_pkt: got "SO2" value
I (62100) datoms_firmware_main: hardcodded_config_running_task: data_handle_final_data is:
I (62110) datoms_firmware_main: value raw_value
I (62120) datoms_firmware_main: {"type":"data","message":{"d":"28:03:2022","t":"16:08:53","i":"1","dp":{"PM":"0.937504","PM_r":"4.050000","SO2":"2.812502","SO2_r":"4.150000","debug":{"errno":"0","sig1":"7","net":"9","mdm":"1","fw_ver":"5.1.2"}}}}
I (62140) datoms_firmware_main: send_pkt ---------- {"type":"data","message":{"d":"28:03:2022","t":"16:08:53","i":"1","dp":{"PM":"0.937504","PM_r":"4.050000","SO2":"2.812502","SO2_r":"4.150000","debug":{"errno":"0","sig1":"7","net":"9","mdm":"1","
@Rajssss
Rajssss / files_stuffs
Last active January 25, 2022 15:30
Some useful function around files C
/*
* List all directories and files recursively inside the given path
* as tree view
*/
static void list_files_as_tree(char *basePath, const int root)
{
/*
* Warning: This code requires hell lot of memory (stack)
*/
@Rajssss
Rajssss / printf_file_name_line_no.c
Created December 29, 2021 07:50
printf print line no and file name
#include <stdio.h>
/* redefine printf for the rest of file. */
#define printf(...) \
do { \
printf("%s: %d:\t", __FILE__, __LINE__);\
printf(__VA_ARGS__);\
} while (0)
/* after this point, each call to printf will be replaced by two. */
@Rajssss
Rajssss / install-supersu-to-anbox.sh
Last active June 1, 2022 04:28
script to root anbox with supersu.
#!/bin/bash -v
#some code edited from root@geeks-r-us.de
#Modified script by https://github.com/rypz79, taken from https://github.com/anbox/anbox/issues/894#issuecomment-420766769
#Tested with SuperSU-v2.82-201705271822 only!! Check test system details in comments.
set -e
#get zip file and set workdir
mkdir -p ~/temp
@Rajssss
Rajssss / mount-ubi-using-mtdram.sh
Created October 15, 2021 19:16 — forked from ndunks/mount-ubi-using-mtdram.sh
How to mount UBI image using mtdram kernel module on linux/debian
#!/bin/bash
if [ ! -d files ]; then
# Make the content
echo "Generating root content.."
mkdir files
echo "$(date)" > files/date.txt
echo "Another content" > files/other.txt
fi
#These config are based by Nand device that you will use!
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.2-00066
S - IMAGE_VARIANT_STRING=LAATANAZA
S - OEM_IMAGE_VERSION_STRING=debian-server
S - Boot Config, 0x000000e1
B - 1216 - PBL, Start
B - 3723 - bootable_media_detect_entry, Start
B - 4374 - bootable_media_detect_success, Start
@Rajssss
Rajssss / param_update.c
Created September 20, 2021 09:25
airpurifier ui param update
#include <stdlib.h>
#include <time.h>
#include "datoms_airpurifier_main.h"
#include "main_screen.h"
void datoms_test_param_update(void);
void humidity_update_param(lv_task_t *task);
void pm_update_param(lv_task_t *task);
@Rajssss
Rajssss / colab_build_systems_setup.ipynb
Last active October 12, 2021 05:11
Colab_Build_Systems_Setup.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Rajssss
Rajssss / redshift.conf
Last active June 9, 2021 06:26
Redshift linux multi monitor config for no identical monitor with different color temp and brightness. Requires two conf files.
$ redshift -c ~/.config/redshift.conf
; Primary Monitor
; Global settings
[redshift]
temp-day=4200K
temp-night=3900k
transition=1
;gamma=0.8:0.7:0.8