2023.05.29 17:47 ily4evr Suggest 3 upgrades(preferably icons that performs well), budget 120mil
![]() | submitted by ily4evr to FUTMobile [link] [comments] |
2023.05.29 16:20 NeedleworkerInside57 Old timex expedition and Marlin
2023.05.29 15:48 Solart64 A 1231 pDPS axe i've made on ssf
![]() | submitted by Solart64 to pathofexile [link] [comments] |
2023.05.29 12:28 ma115a Terribly slow Wi-Fi, basically unusable
![]() | A couple a days ago I upgraded my Wi-Fi card to an Intel AX210 from a Mediatek MT7921 due to a problem with my laptop not being able to wake up from sleep and also due to a really buggy internet connection on Windows and on Manjaro(I have a persistent USB with Manjaro running on it). submitted by ma115a to ManjaroLinux [link] [comments] So basically my problem is that it takes a long time to connect to my network and when it does it is basically unusable, loading google takes like 30sec or even more so there is no point in testing the internet speed. I have tried different kernels, 5.15, 6.1 and even 6.3 but it's all the same. I tried using wavemon to see if I can catch something weird but nothing really, all I found was that power save was on by default and I turned it off(I'll attach a screenshot of wavemon somewhere here). For now I have found that sharing that same network through my phone until I find a solution for the problem. If someone has anything in mind what would cause this issue please advise. Here's the output from: inxi -Fazy System: Kernel: 6.3.4-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1 parameters: BOOT_IMAGE=/boot/vmlinuz-6.3-x86_64 root=UUID=55199c28-ddde-4dc5-ac59-cec1239bb86a rw quiet splash udev.log_priority=3 Desktop: KDE Plasma v: 5.27.4 tk: Qt v: 5.15.9 wm: kwin_x11 vt: 1 dm: SDDM Distro: Manjaro Linux base: Arch Linux Machine: Type: Laptop System: Dell product: Inspiron 14 5425 v: 1.8.0 serial:Here's the output from: modinfo iwlwifi grep parm parm: debug:debug output mask (uint) parm: swcrypto:using crypto in software (default 0 [hardware]) (int) parm: 11n_disable:disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX (uint) parm: amsdu_size:amsdu size 0: 12K for multi Rx queue devices, 2K for AX210 devices, 4K for other devices 1:4K 2:8K 3:12K (16K buffers) 4: 2K (default 0) (int) parm: fw_restart:restart firmware in case of error (default true) (bool) parm: nvm_file:NVM file name (charp) parm: uapsd_disable:disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3) (uint) parm: enable_ini:0:disable, 1-15:FW_DBG_PRESET Values, 16:enabled without preset value defined,Debug INI TLV FW debug infrastructure (default: 16) parm: bt_coex_active:enable wifi/bt co-exist (default: enable) (bool) parm: led_mode:0=system default, 1=On(RF On)/Off(RF Off), 2=blinking, 3=Off (default: 0) (int) parm: power_save:enable WiFi power management (default: disable) (bool) parm: power_level:default power save level (range from 1 - 5, default: 1) (int) parm: disable_11ac:Disable VHT capabilities (default: false) (bool) parm: remove_when_gone:Remove dev from PCIe bus if it is deemed inaccessible (default: false) (bool) parm: disable_11ax:Disable HE capabilities (default: false) (bool) parm: disable_11be:Disable EHT capabilities (default: false) (bool) wavemon output |
2023.05.29 02:26 MaxGanzII Redshift Research Project : Redshift Serverless First Numbers
2023.05.28 22:57 lazyspock Colorizing pictures with SD + MultiControlNet - a guide (examples at the end of the post)
![]() | METHOD FOR COLORIZING PICTURES USING STABLE DIFFUSIONThis method is not perfect and has its limitations. Images that are too complex, or too grainy/pixelated, etc, will present a challenge. Another thing you have to have in mind is that SD is not really COLORIZING the picture, but GENERATING A NEW COLOR IMAGE. So, if you need the output image to be an exact copy of the input one (only colored), this will probably not work. But, as you can see in the examples I’m posting below, I got very good results in my tests. So, test away and give us your feedback below.Another important thing: someone will probably start from this process and make it better, and this is fantastic – this is exactly why this community is so important. So, if you happen to be this someone, please post your new method for everyone to see. I’ll be grateful if you link mine when you do so, but even if you don’t it will be a huge help to everyone, me included. That said, let’s see the method and, after that, some examples I did. THE METHOD 1) PREPARATION a. Select your input B&W image. The clearer (no pixelation, no graininess, etc) the better, but there are ways to make the result better in case of less-than-perfect input images b. Open your image in a photo editing software. Make small adjustments (like brightness, contrast, removing scratches, etc). c. Also, change the canvas size to a proportion that Stable Diffusion can generate images on, like 1:1, or 1:1.5, etc. DO NOT RESIZE the image down, only CUT the image to the correct proportion. Example: if you have a 3324 x 2300 pixels image (1:1.4452 ratio), cut it to 3324 x 2216 pixels (1:1.5 ratio), so you can use 512 x 768 (also 1.5 ratio) to generate your output image in Stable Diffusion. About the reason for not resizing it down: ControlNet give better results with larger images (more details = better results). d. Save the cleaned, correctly-sized image as a PNG file or as a JPG file with no compression 2) CONTROLNET a. You will need at least two simultaneous instances of ControlNet. If you don’t have more than one ControlNet tab in your TXT2IMG tab, go to the Stable Diffusion settings tab, select CONTROLNET in the left menu, and change the “Multi ControlNet” slider to at least two. After that, apply the settings and restart Stable Diffusion, and you will have the multiple ControlNet tabs to work into. b. In CONTROLNET UNIT 0: i. Load your input image (the one you’ve saved in the PREPARATION step) ii. Enable ControlNet iii. PREPROCESSOR: lineart_realistic iv. MODEL: control_v11p_sd15_lineart v. CONTROL WEIGHT: Around 0,7 (try values from 0,5 to 1,0 depending on your image) c. In CONTROLNET UNIT 1: i. Load your input image (the same one) ii. Enable ControlNet iii. PREPROCESSOR: depth_leres+++ iv. MODEL: control_v11f1p_sd15_depth v. CONTROL WEIGHT: Around 0,4 (try values from 0,3 to 0,6 depending on your image) 3) TXT2IMG SETTINGS a. MODEL: RealisticVision 2.0 b. SAMPLING METHOD: DPM++ 2M Karras c. SAMPLING STEPS: Around 18 (avoid going to high or the colors will not be right; try from 15 to 25 depending on your image) d. CFG: around 3.5 (again, avoid much higher CFGs; from 2.5 to 5 will probably do) e. RESTORE FACES: ON f. WIDTH and HEIGHT: Try to stay inside the 512-to-768 range for both dimensions, and use the exact same ratio of the input image (as you saved it in the PREPARATION step) g. BATCH SIZE: you decide. I normally use from 2 to 4 here, so I can have several images to choose from without waiting for a long time. h. POSITIVE PROMPT: [BRIEF DESCRIPTION OF THE IMAGE], detailed (wrinkles, blemishes, folds, moles, veins, pores, skin imperfections:1.1), highly detailed glossy eyes, (looking at the camera), specular lighting, dslr, ultra quality, sharp focus, tack sharp, dof, film grain, centered, Fujifilm XT3, crystal clear i. NEGATIVE PROMPT: out of frame, tattoo, b&w, sepia, (blurry un-sharp fuzzy un-detailed skin:1.4), (twins:1.4), (geminis:1.4), (wrong eyeballs:1.1), (cloned face:1.1), (perfect skin:1.2), (mutated hands and fingers:1.3), disconnected hands, disconnected limbs, amputation, (semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, doll, overexposed, photoshop, oversaturated:1.4) 4) CLICK GENERATE as many times as you want until you get what you want. Play with the parameters (especially the ControlNet weights) and see how it changes the results 5) If needed, after selectiong the winner image, make small corrections (fingertips, etc) using Photoshop/Paint Shop Pro/Gimp/etc 6) EXTRA STEP FOR CASES WHERE YOU NEED TO KEEP THE EXACT SAME FACE ON THE OUTPUT (used in the "Einstein Example" below) a. If your input image is a very close shot of someone’s face, or if the input image is not as clear as it could be, maybe the resulting colored image will be a likeness of the original person, but slightly different. There’s no magical solution for this, but I’ve used a method (outside Stable Diffusion) that gave me good results BUT ONLY WORKS WHEN THE BACKGROUND IS EXACTLY THE SAME IN BOTH IMAGES: i. I’ve used Paint Shop Pro, that I own, but you can do the same using Photoshop, Gimp and other image editing software ii. Load the ORIGINAL image into Paint Shop Pro iii. Also load the COLORED image into PSP iv. RESIZE one of them to be the exact same size of the other (not only the RATIO, but the PIXEL SIZE). In PSP it’s possible to upscale the smaller image using an “AI UPSCALER”, or you could do the same using Stable Diffusion or Topaz Gigapixel (if you own it). Anyway, the ideal would be to UPSCALE the smaller image, not to DOWNSCALE the larger one, but if you can’t do it, then downscale it is. v. After you have both images with the exact same size (width and height) and IF YOU HAVE USED THE EXACT SAME RATIO FOR THE INPUT AND OUTPUT IMAGES as instructed in the PREPARATION step, you’re good to go vi. Go to the original, B&W image that you’ve loaded in PSP, and create a new RASTER LAYER vii. Go to the colorized image (that was also loaded), select the entire image (CONTROL+A) and COPY IT TO THE CLIPBOARD (CONTROL+C) viii. Go back to the original B&W image, select the new, empty layer, and again select the entire image (CONTROL+A). Then, paste the contents of the clipboard into the selection (CONTROL+SHIFT+L) ix. Now you have two layers: the bottom one is the B&W image (that’s not appearing at all), and the top one is the colorized image (that is the only thing you can see, as it’s covering the B&W image). x. Now, play with the OPACITY of this top, colorized layer, trying to mix its colors with the B&W image below. In my tests, values around 50% tend to give good results. Your colors will be faded, but don’t worry, try to get a image where you have the faces below clearly visible, but using the colors from the top image. Again, if you haven’t used the exact same proportions to generate the color image, you’ll probably have two unaligned images by now, making your job harder or even impossible; and if your images have complex and different backgrounds it will be a problem. xi. When you find something you like, select the entire image (CTRL+A) and copy it “merged”, i.e., as a flat, single layer (there’s no shortcut for this, just go to EDIT -> COPY SPECIAL -> COPY MERGED). Then, paste the image you’ve copied as a new image (CONTROL+SHIFT+V). Please note that you could also have “flattened” the image to one single layer, but keeping the original, multilayered image intact you can go back to it later and change the parameters if you’re not happy with your final result xii. Now, go to the new, flattened image and turn the saturation up (SHIFT+H will open the slider, and then play with it). Don’t overdo it, or you will end up with an oversaturated image. xiii. When you find the right saturation value, click OK and then open the brightness and contrast sliders (SHIFT+B) and also adjust these. And that’s it! You now have a colorized image! SOME EXAMPLES BELOW. The only one I've post-edited in Paint Shop Pro (using the "mixing" method from STEP 6 above) was the Einstein one, since the generated SD image had a slightly different face. SOURCE OF THE INPUT IMAGES: https://www.pexels.com/photo/stylish-man-with-modern-haircut-and-beard-4969919/ https://www.pexels.com/photo/woman-on-paddleboard-board-on-water-7790589/ https://www.pexels.com/photo/monochrome-photo-of-man-in-suit-7265996/ https://upload.wikimedia.org/wikipedia/commons/8/87/Albert_Einstein_and_his_wife_Mileva_Maric.jpg https://preview.redd.it/ds065algym2b1.png?width=1157&format=png&auto=webp&s=c36aed52f04db52909f535c05a7035b107c28f97 |
2023.05.28 22:17 shootthesound A note on high resolution images
![]() | With all the talk of upscaling with Tiles etc recently (which is awesome), its worth remembering just how well vanilla HiRes fix can work at high values, like 4 X for example (512-768 2048x3072 ), especially with low config scales (2-5). I sometimes use the add detail Lora to great effect in compensating for the low cfg also. submitted by shootthesound to StableDiffusion [link] [comments] https://preview.redd.it/7uemk0zmrm2b1.png?width=2048&format=png&auto=webp&s=fb1de21d1b59f8d3bcff9c6799016442af97dee5 |
2023.05.28 20:59 TheConceptBoy Simple timer based LED blink not working.
// CONFIG1 #pragma config FEXTOSC = ECH // External Oscillator mode selection bits (EC above 8MHz; PFM set to high power) #pragma config RSTOSC = EXT1X // Power-up default value for COSC bits (EXTOSC operating per FEXTOSC bits) #pragma config CLKOUTEN = OFF // Clock Out Enable bit (CLKOUT function is disabled; i/o or oscillator function on OSC2) #pragma config CSWEN = ON // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable bit (FSCM timer enabled) // CONFIG2 #pragma config MCLRE = ON // Master Clear Enable bit (MCLR pin is Master Clear function) #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config LPBOREN = OFF // Low-Power BOR enable bit (ULPBOR disabled) #pragma config BOREN = ON // Brown-out reset enable bits (Brown-out Reset Enabled, SBOREN bit is ignored) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (VBOR) set to 1.9V on LF, and 2.45V on F Devices) #pragma config ZCD = OFF // Zero-cross detect disable (Zero-cross detect circuit is disabled at POR.) #pragma config PPS1WAY = ON // Peripheral Pin Select one-way control (The PPSLOCK bit can be cleared and set only once in software) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable bit (Stack Overflow or Underflow will cause a reset) // CONFIG3 #pragma config WDTCPS = WDTCPS_31// WDT Period Select bits (Divider ratio 1:65536; software control of WDTPS) #pragma config WDTE = OFF // WDT operating mode (WDT Disabled, SWDTEN is ignored) #pragma config WDTCWS = WDTCWS_7// WDT Window Select bits (window always open (100%); software control; keyed access not required) #pragma config WDTCCS = SC // WDT input clock selector (Software Control) // CONFIG4 #pragma config BBSIZE = BB512 // Boot Block Size Selection bits (512 words boot block size) #pragma config BBEN = OFF // Boot Block Enable bit (Boot Block disabled) #pragma config SAFEN = OFF // SAF Enable bit (SAF disabled) #pragma config WRTAPP = OFF // Application Block Write Protection bit (Application Block not write protected) #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block not write protected) #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration Register not write protected) #pragma config WRTSAF = OFF // Storage Area Flash Write Protection bit (SAF not write protected) #pragma config LVP = ON // Low Voltage Programming Enable bit (Low Voltage programming enabled. MCLVpp pin function is MCLR.) // CONFIG5 #pragma config CP = OFF // UserNVM Program memory code protection bit (UserNVM code protection disabled) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include// include processor files - each processor file is guarded. #include #define _XTAL_FREQ 8000000 _Bool LEDstate = 1; void main(void) { TRISA = 0b00000000; PORTAbits.RA2 = LEDstate; // reset led INTCONbits.GIE = 1; INTCONbits.PEIE = 1; INTCONbits.INTEDG = 1; TMR0H = 0x0B; TMR0L = 0xDC; T0CON0 = 0b10010000; T0CON1 = 0b01000110; while(1){ } } __interrupt() void timer_0(void){ if (PIR0bits.TMR0IF == 1){ LEDstate ^= 1; PORTAbits.RA2 = LEDstate; TMR0H = 0x0B; TMR0L = 0xDC; PIR0bits.TMR0IF = 0; } }
2023.05.28 06:54 Allan_Titan Soul tomato?
![]() | Currently playing anniversary edition on my switch when I came across these in my inventory. And no idk where I got them from submitted by Allan_Titan to skyrim [link] [comments] |
2023.05.28 06:16 skategod0012 How do I set a new max temp in marlin
![]() | submitted by skategod0012 to MarlinFirmware [link] [comments] |
2023.05.28 03:34 Dedicated_Grinder W/L
![]() | submitted by Dedicated_Grinder to bloxfruits [link] [comments] |
2023.05.28 02:56 ceetharabbits2 Grand canyon 5 new or trek Marlin 7 used?
2023.05.28 02:37 spin7ion Simple voice recorder problem
/* Includes ------------------------------------------------------------------*/ #include "main.h" #include "fatfs.h" #include "usb_device.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "stdio.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ #define I2S_DATA_WORD_LENGTH (24) // industry-standard 24-bit I2S #define I2S_FRAME (32) // bits per sample /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ ADC_HandleTypeDef hadc1; I2S_HandleTypeDef hi2s3; DMA_HandleTypeDef hdma_spi3_rx; SPI_HandleTypeDef hspi1; TIM_HandleTypeDef htim4; UART_HandleTypeDef huart1; /* USER CODE BEGIN PV */ // ===FILES=== FATFS fs; FIL fil; FRESULT res; uint32_t temp_number; // === State === #define STATE_START_REC 0 #define STATE_REC 1 #define STATE_STOP_REC 2 #define STATE_WAITING 3 volatile uint8_t state=STATE_START_REC; // === Audio === #define WAV_WRITE_SAMPLE_COUNT 512 uint8_t data_i2s[WAV_WRITE_SAMPLE_COUNT]; static uint8_t first_time = 0; volatile uint8_t half_i2s, full_i2s; static uint8_t wav_file_header[44]={0x52, 0x49, 0x46, 0x46, 0xa4, 0xa9, 0x03, 0x00, 0x57 ,0x41, 0x56, 0x45, 0x66, 0x6d, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x7d, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x04, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x80, 0xa9, 0x03, 0x00}; static uint32_t wav_file_size; /*uint16_t aud_buf[2*BUFFER_SIZE]; // Double buffering unsigned int written=0; unsigned long fileSize = 0L; unsigned long waveChunk = 16; //bit size unsigned int waveType = 1; // unsigned int numChannels = 1; //1:mono 2:stereo unsigned long sampleRate = 15625; //samples per sec unsigned long bytesPerSec = 46875; //samplerate*NumChannels*(Bitpersample/8) unsigned int blockAlign = 3; //NumChannels*Bitpersample/8 unsigned int bitsPerSample = 24; unsigned long dataSize = 0L; unsigned long recByteSaved = 0L; char bytes[5]; int lenOfBufferToWrite = 0; int temp = 0;*/ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); static void MX_ADC1_Init(void); static void MX_SPI1_Init(void); static void MX_USART1_UART_Init(void); static void MX_TIM4_Init(void); static void MX_I2S3_Init(void); /* USER CODE BEGIN PFP */ void errorHandler(); /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ void convert_endianness(uint32_t *array, uint16_t Size) { for (int i = 0; i < Size; i++) { array[i] = __REV(array[i]); } } void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) { full_i2s = 1; } void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) { half_i2s = 1; } void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { if (htim->Instance == htim4.Instance) { if(state==STATE_REC){ state=STATE_STOP_REC; } } } int _write(int file, char *ptr, int len) { int DataIdx; for (DataIdx = 0; DataIdx < len; DataIdx++) { ITM_SendChar(*ptr++); } return len; } void start_recording_fname(char *filename, uint32_t frequency) { uint32_t byte_rate = frequency * 2 * 2; wav_file_header[24] = (uint8_t)frequency; wav_file_header[25] = (uint8_t)(frequency >> 8); wav_file_header[26] = (uint8_t)(frequency >> 16); wav_file_header[27] = (uint8_t)(frequency >> 24); wav_file_header[28] = (uint8_t)byte_rate; wav_file_header[29] = (uint8_t)(byte_rate >> 8); wav_file_header[30] = (uint8_t)(byte_rate >> 16); wav_file_header[31] = (uint8_t)(byte_rate >> 24); // creating a file res = f_open(&fil ,filename, FA_OPEN_ALWAYS FA_WRITE FA_READ); if(res != 0) { printf("error in creating a file: %d \n", res); Error_Handler(); } else { res = f_write(&fil,wav_file_header, 44,(UINT*)&temp_number); printf("Created wav \n"); } wav_file_size = 0; } void write2wave_file(uint8_t *data, uint16_t data_size) { uint32_t temp_number; printf("w\n"); if(first_time == 0) { for(int i = 0; i < 44; i++) { *(data + i) = wav_file_header[i]; } first_time = 1; } res = f_write(&fil,(void *)data, data_size,(UINT*)&temp_number); if(res != 0) { printf("error in writing to the file: %d \n", res); Error_Handler(); } res=f_sync(&fil); wav_file_size += data_size; } void stop_recording() { HAL_I2S_DMAStop(&hi2s3); half_i2s = 0; full_i2s = 0; // updating data size sector wav_file_size -= 8; wav_file_header[4] = (uint8_t)wav_file_size; wav_file_header[5] = (uint8_t)(wav_file_size >> 8); wav_file_header[6] = (uint8_t)(wav_file_size >> 16); wav_file_header[7] = (uint8_t)(wav_file_size >> 24); wav_file_size -= 36; wav_file_header[40] = (uint8_t)wav_file_size; wav_file_header[41] = (uint8_t)(wav_file_size >> 8); wav_file_header[42] = (uint8_t)(wav_file_size >> 16); wav_file_header[43] = (uint8_t)(wav_file_size >> 24); // moving to the beginning of the file to update the file format f_lseek(&fil, 0); res=f_write(&fil,(void *)wav_file_header, sizeof(wav_file_header),(UINT*)&temp_number); if(res != 0) { printf("error in updating the first sector: %d \n", res); Error_Handler(); } f_sync(&fil); f_close(&fil); first_time = 0; printf("closed the file \n"); } void incrementRunCounter() { FILINFO fno; res=f_stat("init.txt", &fno); uint8_t a=0; char test[15]; if(res==FR_NO_FILE){ res=f_open(&fil, "init.txt", FA_OPEN_ALWAYS FA_WRITE FA_READ); res=f_puts("1", &fil); }else{ res=f_open(&fil, "init.txt", FA_OPEN_ALWAYS FA_WRITE FA_READ); f_gets(test, 15, &fil); a=atoi(test); a++; sprintf(test,"%d",a); f_lseek(&fil, 0); //res=f_puts(test, &fil); res = f_write(&fil, test, strlen(test),(UINT*)&temp_number); } f_sync(&fil); res=f_close(&fil); } /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init(); MX_SPI1_Init(); MX_USART1_UART_Init(); MX_FATFS_Init(); MX_USB_DEVICE_Init(); MX_TIM4_Init(); MX_I2S3_Init(); /* USER CODE BEGIN 2 */ //HAL_I2S_DMAStop(&hi2s2); HAL_Delay(500); printf("Hello\n"); res=f_mount(&fs, "0", 0); if(res != 0) { printf("can't mount %d\n", res); Error_Handler(); } incrementRunCounter(); HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_RESET); for(uint8_t i=0;i<3;i++){ HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_RESET); HAL_Delay(500); HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_SET); HAL_Delay(500); } start_recording_fname("test2.wav", I2S_AUDIOFREQ_32K); HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_RESET); HAL_TIM_Base_Start_IT(&htim4); state=STATE_REC; // divide by 32 because we have full word data width DMA but buffer is 1 byte array HAL_I2S_Receive_DMA(&hi2s3, (uint16_t *)data_i2s, WAV_WRITE_SAMPLE_COUNT/32); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { if(state==STATE_REC){ if(half_i2s == 1) { write2wave_file(data_i2s, WAV_WRITE_SAMPLE_COUNT/2); half_i2s = 0; } if(full_i2s == 1) { write2wave_file(data_i2s + WAV_WRITE_SAMPLE_COUNT/2, WAV_WRITE_SAMPLE_COUNT/2); full_i2s = 0; } } else if(state==STATE_STOP_REC) { stop_recording(); state=STATE_WAITING; HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_SET); } /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** * @brief System Clock Configuration * @retval None */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Configure the main internal regulator output voltage */ __HAL_RCC_PWR_CLK_ENABLE(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 25; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; RCC_OscInitStruct.PLL.PLLQ = 7; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB buses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLKRCC_CLOCKTYPE_SYSCLK RCC_CLOCKTYPE_PCLK1RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV2; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { Error_Handler(); } } /** * @brief ADC1 Initialization Function * @param None * @retval None */ static void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.ScanConvMode = DISABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DMAContinuousRequests = DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; if (HAL_ADC_Init(&hadc1) != HAL_OK) { Error_Handler(); } /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. */ sConfig.Channel = ADC_CHANNEL_0; sConfig.Rank = 1; sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN ADC1_Init 2 */ /* USER CODE END ADC1_Init 2 */ } /** * @brief I2S3 Initialization Function * @param None * @retval None */ static void MX_I2S3_Init(void) { /* USER CODE BEGIN I2S3_Init 0 */ /* USER CODE END I2S3_Init 0 */ /* USER CODE BEGIN I2S3_Init 1 */ /* USER CODE END I2S3_Init 1 */ hi2s3.Instance = SPI3; hi2s3.Init.Mode = I2S_MODE_MASTER_RX; hi2s3.Init.Standard = I2S_STANDARD_PHILIPS; hi2s3.Init.DataFormat = I2S_DATAFORMAT_24B; hi2s3.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE; hi2s3.Init.AudioFreq = I2S_AUDIOFREQ_32K; hi2s3.Init.CPOL = I2S_CPOL_HIGH; hi2s3.Init.ClockSource = I2S_CLOCK_PLL; hi2s3.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_DISABLE; if (HAL_I2S_Init(&hi2s3) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN I2S3_Init 2 */ /* USER CODE END I2S3_Init 2 */ } /** * @brief SPI1 Initialization Function * @param None * @retval None */ static void MX_SPI1_Init(void) { /* USER CODE BEGIN SPI1_Init 0 */ /* USER CODE END SPI1_Init 0 */ /* USER CODE BEGIN SPI1_Init 1 */ /* USER CODE END SPI1_Init 1 */ /* SPI1 parameter configuration*/ hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_2LINES; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 10; if (HAL_SPI_Init(&hspi1) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN SPI1_Init 2 */ /* USER CODE END SPI1_Init 2 */ } /** * @brief TIM4 Initialization Function * @param None * @retval None */ static void MX_TIM4_Init(void) { /* USER CODE BEGIN TIM4_Init 0 */ /* USER CODE END TIM4_Init 0 */ TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; /* USER CODE BEGIN TIM4_Init 1 */ /* USER CODE END TIM4_Init 1 */ htim4.Instance = TIM4; htim4.Init.Prescaler = 21000; htim4.Init.CounterMode = TIM_COUNTERMODE_UP; htim4.Init.Period = 32000; htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_Base_Init(&htim4) != HAL_OK) { Error_Handler(); } sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; if (HAL_TIM_ConfigClockSource(&htim4, &sClockSourceConfig) != HAL_OK) { Error_Handler(); } sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN TIM4_Init 2 */ /* USER CODE END TIM4_Init 2 */ } /** * @brief USART1 Initialization Function * @param None * @retval None */ static void MX_USART1_UART_Init(void) { /* USER CODE BEGIN USART1_Init 0 */ /* USER CODE END USART1_Init 0 */ /* USER CODE BEGIN USART1_Init 1 */ /* USER CODE END USART1_Init 1 */ huart1.Instance = USART1; huart1.Init.BaudRate = 115200; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Mode = UART_MODE_TX_RX; huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart1.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&huart1) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN USART1_Init 2 */ /* USER CODE END USART1_Init 2 */ } /** * Enable DMA controller clock */ static void MX_DMA_Init(void) { /* DMA controller clock enable */ __HAL_RCC_DMA1_CLK_ENABLE(); /* DMA interrupt init */ /* DMA1_Stream0_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Stream0_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn); } /** * @brief GPIO Initialization Function * @param None * @retval None */ static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET); /*Configure GPIO pin : PIN_LED_Pin */ GPIO_InitStruct.Pin = PIN_LED_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(PIN_LED_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pin : PA4 */ GPIO_InitStruct.Pin = GPIO_PIN_4; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /*Configure GPIO pin : PA8 */ GPIO_InitStruct.Pin = GPIO_PIN_8; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } /* USER CODE BEGIN 4 */ /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while(1){ HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_RESET); HAL_Delay(100); HAL_GPIO_WritePin(PIN_LED_GPIO_Port, PIN_LED_Pin, GPIO_PIN_SET); HAL_Delay(100); } /* USER CODE END Error_Handler_Debug */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */Please help me.
2023.05.27 22:51 AbrocomaFirm4287 MCU Error Klipper
2023.05.27 20:36 DryGift1435 Which XPS is right for me?
2023.05.27 20:35 DryGift1435 Which XPS should I get?
2023.05.27 14:59 GG_Ens Potentiometers wobbling using Arduino Joystick Library
2023.05.27 09:45 AccordingMongoose902 I’m a Zillionaire
![]() | Just became a Zillionaire by investing in crypto for years lmao submitted by AccordingMongoose902 to BitLifeApp [link] [comments] |
2023.05.27 08:31 hikaruu876 HELP: Aurora R13 suddenly loud fan than started to have fan related issue and cannot boot correctly,
2023.05.27 04:11 ChucksFeedAndSeed Yuzu TotK fixed-1080p-AO build (EA 3617)
diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index e8ddde6..4353eae 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -115,6 +115,13 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { rescaleable &= (block.depth == 0) && resources.levels == 1; rescaleable &= size.height > 256 GetFormatType(format) != SurfaceType::ColorTexture; downscaleable = size.height > 512; + + // Disable rescaling if this is a TotK 1080p AO texture (height = 1080 / 4) + // Try narrowing to just the AO texture by checking some characteristics of it: + if (size.width == 480 && size.height == 270 && size.depth == 1 && + config.border_size.Value() == 7) { + rescaleable = false; + } } } @@ -156,6 +163,13 @@ ImageInfo::ImageInfo(const Maxwell3D::Regs::RenderTargetConfig& ct, downscaleable = size.height > 512; type = ImageType::e2D; resources.layers = ct.depth; + + // Disable rescaling if this is a TotK 1080p AO texture (height = 1080 / 4) + // Try narrowing to just the AO texture by checking some characteristics of it: + if (size.width == 480 && size.height == 270 && size.depth == 1 && + ct.format == Tegra::RenderTargetFormat::R32_FLOAT && ct.volume.Value() == 0) { + rescaleable = false; + } } }
2023.05.27 02:12 AtomicSilo Batch Extract Metadata from PNG files
pip install pillow
# Extract the metadata metadata = image.info # Write the metadata to the text file f.write(f"File: {filename}\n") f.write(f"Metadata: {metadata}\n") f.write("\n") # Close the image file image.close()
import os from PIL import Image # Directory containing the PNG files input_dir = "path/to/png/files" # Output file path output_file = "path/to/output.txt" # Open the output file in write mode with open(output_file, "w") as f: # Iterate over each file in the directory for filename in os.listdir(directory): if filename.endswith(".png"): file_path = os.path.join(directory, filename) try: # Open the image file image = Image.open(file_path) # Get the metadata (EXIF) from the image metadata = image.info # Extract positive prompt and negative prompt positive_prompt = metadata["parameters"].split("\n")[0] negative_prompt = metadata["parameters"].split("\n")[1].split(": ")[1] # Find the index of the first occurrence of "Steps" in the parameters steps_index = metadata["parameters"].index("Steps:") # Extract the information from the first "Steps" onwards steps_info = metadata["parameters"][steps_index:].split("\nTemplate")[0] # Format the steps_info into separate key-value pairs steps_list = steps_info.split(", ") # Write the extracted information to the output file f.write(f"File: {filename}\n\n") f.write(f"Positive Prompt: {positive_prompt}\n\n") f.write(f"Negative Prompt: {negative_prompt}\n\n") # Write the formatted steps_info to the output file f.write("Configurations:\n") for step in steps_list: f.write(f"{step}\n") f.write("---\n") # Close the image file image.close() except Exception as e: print(f"Error processing file: {filename}") print(e)So now the original output goes from this:
File: 50-1007953940-20230526162755-alphones mucha girl warrior with curly green hair big piercing in the nouse standing with ghost deers warm colors art.png {'parameters': 'alphones mucha girl warrior with curly green hair big piercing in the nouse standing with ghost deers warm colors art-nouveau on paper, smile, nature, fresco mucha flowers in the eyes bleach,8k, vivid colors,hdr\nNegative prompt: bad-picture-chill-75v, style-rustmagic-neg\nSteps: 50, Sampler: DPM++ SDE Karras, CFG scale: 10, Seed: 1007953940, Size: 512x768, Model hash: 4d91c4c217, Model: RA_lyriel_v15, Denoising strength: 0.5, Version: v1.2.1, Hires upscale: 2, Hires steps: 25, Hires upscaler: 4x-UltraSharp\nTemplate: alphones mucha girl warrior with curly green hair big piercing in the nouse standing with ghost deers warm colors art-nouveau on paper, smile, nature, fresco mucha flowers in the eyes bleach,8k, vivid colors,hdr\nNegative Template: bad-picture-chill-75v, style-rustmagic-neg'}To this:
File: 50-1007953940-20230526162755-alphones mucha girl warrior with curly green hair big piercing in the nouse standing with ghost deers warm colors art.pngEach png meta data will be separated
Positive Prompt: alphones mucha girl warrior with curly green hair big piercing in the nouse standing with ghost deers warm colors art-nouveau on paper, smile, nature, fresco mucha flowers in the eyes bleach,8k, vivid colors,hdr
Negative Prompt: bad-picture-chill-75v, style-rustmagic-neg
Configurations: Steps: 50 Sampler: DPM++ SDE Karras CFG scale: 10 Seed: 1007953940 Size: 512x768 Model hash: 4d91c4c217 Model: RA_lyriel_v15 Denoising strength: 0.5 Version: v1.2.1 Hires upscale: 2 Hires steps: 25 Hires upscaler: 4x-UltraSharp
--prompt "alphones mucha girl warrior with curly green hair big piercing in the nouse standing with ghost deers warm colors art-nouveau on paper, smile, nature, fresco mucha flowers in the eyes bleach,8k, vivid colors,hdr" --negative_prompt "bad-picture-chill-75v, style-rustmagic-neg" --steps 50 --sampler_name "DPM++ SDE Karras" --cfg_scale 10 --seed 1007953940 --width 512 --height 768 --sd_model "RA_lyriel_v15"Note: I added the code in Github.
2023.05.26 23:54 Adventurous-Proof622 which one they recommend me buy
![]() | submitted by Adventurous-Proof622 to pcmasterrace [link] [comments] VS https://preview.redd.it/8gbno8oyfa2b1.png?width=1068&format=png&auto=webp&s=ccd8cba3b9409e406730511eef6f60cd0d41f65b |